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.boolean
Two continuous variables are equal if they have the same name and the same missing value marker.getAttribute
(String key) final int
Returns the x coordinate of the center of this node.final int
Returns the y coordinate of the center of this node.final String
getName()
Returns the name of this node.final NodeType
Returns the node type for this node.Returns the node shape for this node.int
hashCode()
Removes a property change listener.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()
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:Node
Returns the name of this node. -
setName
Sets the name of this variable. -
getNodeType
Description copied from interface:Node
Returns the node type for this node.- Specified by:
getNodeType
in interfaceNode
- Returns:
- the node type.
- See Also:
-
setNodeType
Sets the node type.- Specified by:
setNodeType
in interfaceNode
- Parameters:
nodeType
- the node type for this node.- See Also:
-
getCenterX
public final int getCenterX()Description copied from interface:Node
Returns the x coordinate of the center of this node.- 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
- Parameters:
centerX
- This coordinate.
-
getCenterY
public final int getCenterY()Description copied from interface:Node
Returns the y coordinate of the center of this node.- 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
- 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:
addPropertyChangeListener
in interfaceNode
- Parameters:
l
- This listener.
-
toString
Description copied from interface:Node
Returns the intervention type for this node. -
hashCode
public int hashCode()Description copied from interface:Node
Removes 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:Node
Creates a new node of the same type as this one with the given name. -
getNodeVariableType
Description copied from interface:Node
Returns the node shape for this node.- 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
- Parameters:
nodeVariableType
- the type (domain, interventional status, interventional value..) for this node variable
-
getAllAttributes
- Specified by:
getAllAttributes
in interfaceNode
-
getAttribute
- Specified by:
getAttribute
in interfaceNode
-
removeAttribute
- Specified by:
removeAttribute
in interfaceNode
-
addAttribute
- Specified by:
addAttribute
in interfaceNode
-