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 TypeMethodDescriptionvoid
addAttribute
(String key, Object value) final void
Adds a property change listener.int
Alphabetical order.boolean
Two continuous variables are equal if they have the same name and the same missing value marker.getAttribute
(String key) final int
final int
final String
getName()
final NodeType
int
hashCode()
Creates a new node of the same type as this one with the given name.void
removeAttribute
(String key) static GraphNode
Generates a simple exemplar of this class to test serialization.final void
setCenter
(int centerX, int centerY) Sets the (x, y) coordinates of the center of this node.final void
setCenterX
(int centerX) Sets the x coordinate of the center of this node.final void
setCenterY
(int centerY) Sets the y coordinate of the center of this node.final void
Sets the name of this variable.final void
setNodeType
(NodeType nodeType) Sets the node type.void
setNodeVariableType
(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:
getNodeType
in interfaceNode
- Returns:
- the node type.
- See Also:
-
setNodeType
Sets the node type.- Specified by:
setNodeType
in interfaceNode
- See Also:
-
getCenterX
public final int getCenterX()- Specified by:
getCenterX
in 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:
setCenterX
in interfaceNode
-
getCenterY
public final int getCenterY()- Specified by:
getCenterY
in 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:
setCenterY
in 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:
addPropertyChangeListener
in 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:Node
Creates a new node of the same type as this one with the given name. -
compareTo
Description copied from interface:Node
Alphabetical order.- Specified by:
compareTo
in interfaceComparable<Node>
- Specified by:
compareTo
in interfaceNode
-
getNodeVariableType
- Specified by:
getNodeVariableType
in interfaceNode
- Returns:
- the intervention type
-
setNodeVariableType
Description copied from interface:Node
Sets the type (domain, interventional status, interventional value..) for this node variable- Specified by:
setNodeVariableType
in interfaceNode
-
getAllAttributes
- Specified by:
getAllAttributes
in interfaceNode
-
getAttribute
- Specified by:
getAttribute
in interfaceNode
-
removeAttribute
- Specified by:
removeAttribute
in interfaceNode
-
addAttribute
- Specified by:
addAttribute
in interfaceNode
-