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.booleanTwo continuous variables are equal if they have the same name and the same missing value marker.getAttribute(String key) final intReturns the x coordinate of the center of this node.final intReturns the y coordinate of the center of this node.final StringgetName()Returns the name of this node.final NodeTypeReturns the node type for this node.Returns the node shape 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) 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()Returns the intervention type for this node.
-
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
Description copied from interface:NodeReturns the name of this node. -
setName
Sets the name of this variable. -
getNodeType
Description copied from interface:NodeReturns the node type for this node.- Specified by:
getNodeTypein interfaceNode- Returns:
- the node type.
- See Also:
-
setNodeType
Sets the node type.- Specified by:
setNodeTypein interfaceNode- Parameters:
nodeType- the node type for this node.- See Also:
-
getCenterX
public final int getCenterX()Description copied from interface:NodeReturns the x coordinate of the center of this node.- 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- Parameters:
centerX- This coordinate.
-
getCenterY
public final int getCenterY()Description copied from interface:NodeReturns the y coordinate of the center of this node.- 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- Parameters:
centerY- This coordinate.
-
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- Parameters:
l- This listener.
-
toString
Description copied from interface:NodeReturns the intervention type for this node. -
hashCode
public int hashCode()Description copied from interface:NodeRemoves a property change listener. -
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. -
getNodeVariableType
Description copied from interface:NodeReturns the node shape for this node.- 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- Parameters:
nodeVariableType- the type (domain, interventional status, interventional value..) for this node variable
-
getAllAttributes
- Specified by:
getAllAttributesin interfaceNode
-
getAttribute
- Specified by:
getAttributein interfaceNode
-
removeAttribute
- Specified by:
removeAttributein interfaceNode
-
addAttribute
- Specified by:
addAttributein interfaceNode
-