Interface Node
- All Superinterfaces:
Comparable<Node>, Serializable, TetradSerializable
- All Known Subinterfaces:
Variable
- All Known Implementing Classes:
AbstractVariable, ContinuousVariable, DiscreteVariable, GraphNode
Represents an object with a name, node type, and position that can serve as a node in a graph.
- Version:
- $Id: $Id
- Author:
- josephramsey
- See Also:
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAttribute(String key, Object value) addAttribute.voidAdds a property change listener.default intCompares this node to the given node by name, using the shared display order for possibly-lagged names: unlagged names first, then lagged names in order of increasing lag, with natural ordering of base names within a lag group and the raw name as a final tiebreaker, so distinct names never compare equal.booleanTests whether this variable is equal to the given variable.getAllAttributes.getAttribute(String key) getAttribute.intReturns the x coordinate of the center of this node.intReturns the y coordinate of the center of this node.default StringReturns the display name.getName()Returns the name of this node.Returns the node type for this node.Returns the node shape for this node.default intgetRank()Returns the rank, or -1 if no rank is set.booleanReturns the selection bias status for this node.inthashCode()Removes a property change listener.Creates a new node of the same type as this one with the given name.voidremoveAttribute(String key) removeAttribute.voidsetCenter(int centerX, int centerY) Sets the (x, y) coordinates of the center of this node.voidsetCenterX(int centerX) Sets the x coordinate of the center of this node.voidsetCenterY(int centerY) Sets the y coordinate of the center of this node.voidSets the name of this node.voidsetNodeType(NodeType nodeType) Sets the node type for this node.voidsetNodeVariableType(NodeVariableType nodeVariableType) Sets the type (domain, interventional status, interventional value..) for this node variabledefault voidsetRank(int rank) Sets the rank, or -1 if no rank is set.voidsetSelectionBias(boolean selectionBias) Returns the selection bias status for this node.toString()Returns the intervention type for this node.
-
Field Details
-
ALPHA
ConstantALPHA -
ALPHA_NUM
ConstantALPHA_NUM -
LAG
ConstantLAG -
serialVersionUID
static final long serialVersionUIDConstantserialVersionUID=23L- See Also:
-
-
Method Details
-
getName
-
setName
-
getRank
default int getRank()Returns the rank, or -1 if no rank is set.- Returns:
- the rank of the node
-
setRank
default void setRank(int rank) Sets the rank, or -1 if no rank is set.- Parameters:
rank- the rank to set- Throws:
UnsupportedOperationException- if the node type does not support setting a rank.
-
getDisplayName
-
getNodeType
-
setNodeType
Sets the node type for this node.- Parameters:
nodeType- the node type for this node.
-
getSelectionBias
boolean getSelectionBias()Returns the selection bias status for this node.- Returns:
- the selection bias status for this node.
-
setSelectionBias
void setSelectionBias(boolean selectionBias) Returns the selection bias status for this node.- Parameters:
selectionBias- the selection bias status for this node.
-
getNodeVariableType
NodeVariableType getNodeVariableType()Returns the node shape for this node.- Returns:
- the intervention type
-
setNodeVariableType
Sets the type (domain, interventional status, interventional value..) for this node variable- Parameters:
nodeVariableType- the type (domain, interventional status, interventional value..) for this node variable
-
toString
-
getCenterX
int getCenterX()Returns the x coordinate of the center of this node.- Returns:
- the x coordinate of the center of the node.
-
setCenterX
void setCenterX(int centerX) Sets the x coordinate of the center of this node.- Parameters:
centerX- This coordinate.
-
getCenterY
int getCenterY()Returns the y coordinate of the center of this node.- Returns:
- the y coordinate of the center of the node.
-
setCenterY
void setCenterY(int centerY) Sets the y coordinate of the center of this node.- Parameters:
centerY- This coordinate.
-
setCenter
void setCenter(int centerX, int centerY) Sets the (x, y) coordinates of the center of this node.- Parameters:
centerX- The x coordinate.centerY- The y coordinate.
-
addPropertyChangeListener
Adds a property change listener.- Parameters:
l- This listener.
-
hashCode
-
equals
-
like
-
compareTo
Compares this node to the given node by name, using the shared display order for possibly-lagged names: unlagged names first, then lagged names in order of increasing lag, with natural ordering of base names within a lag group and the raw name as a final tiebreaker, so distinct names never compare equal. Never throws.This replaces a bucketed comparison that ordered names by concatenating all their digits, under which distinct lagged names such as "X12:3" and "X1:23" compared equal (both reduce to the digit string "123"), names with digit runs too long for an int crashed with NumberFormatException, and cross-bucket comparisons fell back to raw string order in ways that could violate transitivity.
- Specified by:
compareToin interfaceComparable<Node>- Parameters:
node- the node to be compared.- Returns:
- a negative integer, zero, or a positive integer as this node's name orders before, the same as, or after the given node's name.
-
getAllAttributes
-
getAttribute
-
removeAttribute
-
addAttribute
-