Package com.bayesserver
Class Link
- java.lang.Object
-
- com.bayesserver.Link
-
-
Constructor Summary
Constructors Constructor Description Link(Node from, Node to)Initializes a new instance of theLinkclass with the parent node specified in [from] and the child in [to].Link(Node from, Node to, int temporalOrder)Initializes a new instance of theLinkclass with a specified [temporalOrder], the parent node specified in [from] and the child in [to].
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Linkcopy(Node from, Node to, int temporalOrder)Creates a new link, copying the properties from this instance, such asgetDescription()andgetCustomProperties().CustomPropertyCollectiongetCustomProperties()Gets custom properties associated with this instance.StringgetDescription()Optional description for the link.NodegetFrom()The parent node of the directed link.intgetIndex()The Index of this instance in the collection of links belonging to a network, or -1 if the link does not belong to a network.NetworkgetNetwork()TheNetworkthe link belongs to.NoisyOrdergetNoisyOrder()Gets a value which determines the nature of the effect between the parent node (from) and a noisy child node (to).intgetTemporalOrder()Gets the temporal order of the link.NodegetTo()The child node of the directed link.voidsetDescription(String value)Optional description for the link.voidsetNoisyOrder(NoisyOrder value)Sets a value which determines the nature of the effect between the parent node (from) and a noisy child node (to).
-
-
-
Constructor Detail
-
Link
public Link(Node from, Node to)
Initializes a new instance of theLinkclass with the parent node specified in [from] and the child in [to].- Parameters:
from- The parent node.to- The child node.- Throws:
NullPointerException- Raised if either [from] or [to] is null.
-
Link
public Link(Node from, Node to, int temporalOrder)
Initializes a new instance of theLinkclass with a specified [temporalOrder], the parent node specified in [from] and the child in [to]. If a temporal order is specified that is greater than zero, then a link can connect two nodes (which may be the same) at different times.- Parameters:
from- The parent node.to- The child node.temporalOrder- The temporal order. Must be greater than or equal to zero.- Throws:
NullPointerException- Raised if either [from] or [to] is null.IllegalArgumentException- Raised if [temporalOrder] is negative.
-
-
Method Detail
-
copy
public Link copy(Node from, Node to, int temporalOrder)
Creates a new link, copying the properties from this instance, such asgetDescription()andgetCustomProperties().- Parameters:
from- The parent node.to- The child node.temporalOrder- The temporal order. Must be greater than or equal to zero.- Returns:
- A new link instance.
-
getCustomProperties
public CustomPropertyCollection getCustomProperties()
Gets custom properties associated with this instance. Custom properties allow storage of custom information, which will be saved with the network.
-
getIndex
public int getIndex()
The Index of this instance in the collection of links belonging to a network, or -1 if the link does not belong to a network.
-
getDescription
public String getDescription()
Optional description for the link.
-
setDescription
public void setDescription(String value)
Optional description for the link.
-
getTemporalOrder
public int getTemporalOrder()
Gets the temporal order of the link. If the link is not temporal, zero will be returned.
-
getNoisyOrder
public NoisyOrder getNoisyOrder()
Gets a value which determines the nature of the effect between the parent node (from) and a noisy child node (to). This property has no effect if the child node is not a noisy node.
-
setNoisyOrder
public void setNoisyOrder(NoisyOrder value)
Sets a value which determines the nature of the effect between the parent node (from) and a noisy child node (to). This property has no effect if the child node is not a noisy node.
-
getFrom
public Node getFrom()
The parent node of the directed link.
-
getTo
public Node getTo()
The child node of the directed link.
-
-