Package com.bayesserver
Class NodeDistributionKey
- java.lang.Object
-
- com.bayesserver.NodeDistributionKey
-
- All Implemented Interfaces:
Comparable<NodeDistributionKey>
public final class NodeDistributionKey extends Object implements Comparable<NodeDistributionKey>
Identifies a distribution assigned or to be assigned to a node. Some nodes may have more than one distribution assigned to them (e.g. temporal nodes or noisy nodes), and this is used to differentiate between them.
-
-
Constructor Summary
Constructors Constructor Description NodeDistributionKey()
Initializes a new instance of the NodeDistributionKey class with defaults.NodeDistributionKey(int order)
Initializes a new instance of a NodeDistributionKey.NodeDistributionKey(int order, Node relatedNode)
Initializes a new instance of aNodeDistributionKey
.NodeDistributionKey(Node relatedNode)
Initializes a new instance of aNodeDistributionKey
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(NodeDistributionKey other)
boolean
equals(NodeDistributionKey other)
Indicates whether the current object is equal to another object of the same type.boolean
equals(Object obj)
static NodeDistributionKey
getDefault()
Gets a default instance, which is equivalent to constructing a new instance with the default constructor.int
getOrder()
Gets the temporal order of the related node distribution.Node
getRelatedNode()
Gets the parent of the noisy node this distribution refers to, or the noisy node itself to identify the leak distribution.int
hashCode()
-
-
-
Constructor Detail
-
NodeDistributionKey
public NodeDistributionKey()
Initializes a new instance of the NodeDistributionKey class with defaults.
-
NodeDistributionKey
public NodeDistributionKey(int order)
Initializes a new instance of a NodeDistributionKey.- Parameters:
order
- The temporal order of the node distribution.
-
NodeDistributionKey
public NodeDistributionKey(Node relatedNode)
Initializes a new instance of aNodeDistributionKey
.- Parameters:
relatedNode
- The parent of the noisy node this distribution refers to, or the noisy node itself to identify the leak distribution. This will be null, unless the node is a noisy node.
-
NodeDistributionKey
public NodeDistributionKey(int order, Node relatedNode)
Initializes a new instance of aNodeDistributionKey
.- Parameters:
order
- The temporal order of the related node distribution.relatedNode
- The parent of the noisy node this distribution refers to, or the noisy node itself to identify the leak distribution. This will be null, unless the node is a noisy node.
-
-
Method Detail
-
getDefault
public static NodeDistributionKey getDefault()
Gets a default instance, which is equivalent to constructing a new instance with the default constructor.
-
getOrder
public int getOrder()
Gets the temporal order of the related node distribution.
-
getRelatedNode
public Node getRelatedNode()
Gets the parent of the noisy node this distribution refers to, or the noisy node itself to identify the leak distribution. This will be null, unless the node is a noisy node. A noisy node is specified using multiple distributions, one for each parent and a leak distribution. Set the related node property to a parent, or set it to the current node to set the leak distribution.
-
equals
public boolean equals(NodeDistributionKey other)
Indicates whether the current object is equal to another object of the same type.- Parameters:
other
- An object to compare with this object.- Returns:
- true if the current object is equal to the [other] parameter; otherwise, false.
-
compareTo
public int compareTo(NodeDistributionKey other)
- Specified by:
compareTo
in interfaceComparable<NodeDistributionKey>
-
-