Package edu.cmu.tetrad.graph
Class GraphNode
java.lang.Object
edu.cmu.tetrad.graph.GraphNode
- All Implemented Interfaces:
Node,TetradSerializable,Serializable,Comparable<Node>
Implements a basic node in a graph--that is, a node that is not itself a variable.
- Author:
- josephramsey, Willie Wheeler
- See Also:
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAttribute(String key, Object value) final voidAdds a property change listener.intAlphabetical order.booleanTwo continuous variables are equal if they have the same name and the same missing value marker.getAttribute(String key) final intfinal intfinal StringgetName()final NodeTypeinthashCode()Creates a new node of the same type as this one with the given name.voidremoveAttribute(String key) static GraphNodeGenerates a simple exemplar of this class to test serialization.final voidsetCenter(int centerX, int centerY) Sets the (x, y) coordinates of the center of this node.final voidsetCenterX(int centerX) Sets the x coordinate of the center of this node.final voidsetCenterY(int centerY) Sets the y coordinate of the center of this node.final voidSets the name of this variable.final voidsetNodeType(NodeType nodeType) Sets the node type.voidsetNodeVariableType(NodeVariableType nodeVariableType) Sets the type (domain, interventional status, interventional value..) for this node variabletoString()
-
Constructor Details
-
GraphNode
Constructs a new Tetrad node with the given (non-null) string. -
GraphNode
Copy constructor.
-
-
Method Details
-
serializableInstance
Generates a simple exemplar of this class to test serialization. -
getName
-
setName
Sets the name of this variable. -
getNodeType
- Specified by:
getNodeTypein interfaceNode- Returns:
- the node type.
- See Also:
-
setNodeType
Sets the node type.- Specified by:
setNodeTypein interfaceNode- See Also:
-
getCenterX
public final int getCenterX()- Specified by:
getCenterXin interfaceNode- Returns:
- the x coordinate of the center of the node.
-
setCenterX
public final void setCenterX(int centerX) Sets the x coordinate of the center of this node.- Specified by:
setCenterXin interfaceNode
-
getCenterY
public final int getCenterY()- Specified by:
getCenterYin interfaceNode- Returns:
- the y coordinate of the center of the node.
-
setCenterY
public final void setCenterY(int centerY) Sets the y coordinate of the center of this node.- Specified by:
setCenterYin interfaceNode
-
setCenter
public final void setCenter(int centerX, int centerY) Sets the (x, y) coordinates of the center of this node. -
addPropertyChangeListener
Adds a property change listener.- Specified by:
addPropertyChangeListenerin interfaceNode
-
toString
-
hashCode
public int hashCode() -
equals
Two continuous variables are equal if they have the same name and the same missing value marker. -
like
Description copied from interface:NodeCreates a new node of the same type as this one with the given name. -
compareTo
Description copied from interface:NodeAlphabetical order.- Specified by:
compareToin interfaceComparable<Node>- Specified by:
compareToin interfaceNode
-
getNodeVariableType
- Specified by:
getNodeVariableTypein interfaceNode- Returns:
- the intervention type
-
setNodeVariableType
Description copied from interface:NodeSets the type (domain, interventional status, interventional value..) for this node variable- Specified by:
setNodeVariableTypein interfaceNode
-
getAllAttributes
- Specified by:
getAllAttributesin interfaceNode
-
getAttribute
- Specified by:
getAttributein interfaceNode
-
removeAttribute
- Specified by:
removeAttributein interfaceNode
-
addAttribute
- Specified by:
addAttributein interfaceNode
-