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.
- Version:
- $Id: $Id
- Author:
- josephramsey, Willie Wheeler
- See Also:
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAttribute
(String key, Object value) addAttribute.final void
Adds a property change listener.boolean
Tests whether this variable is equal to the given variable.getAllAttributes.getAttribute
(String key) getAttribute.final int
Getter for the fieldcenterX
.final int
Getter for the fieldcenterY
.final String
getName()
Getter for the fieldname
.final NodeType
Getter for the fieldnodeType
.Returns the node shape for this node.int
hashCode()
hashCode.Creates a new node of the same type as this one with the given name.void
removeAttribute
(String key) removeAttribute.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 node.final void
setNodeType
(NodeType nodeType) Sets the node type for this node.void
setNodeVariableType
(NodeVariableType nodeVariableType) Sets the type (domain, interventional status, interventional value..) for this node variabletoString()
toString.
-
Constructor Details
-
Method Details
-
serializableInstance
Generates a simple exemplar of this class to test serialization.- Returns:
- a
GraphNode
object
-
getName
Getter for the field
name
. -
setName
Sets the name of this node.Sets the name of this variable.
-
getNodeType
Getter for the field
nodeType
.- Specified by:
getNodeType
in interfaceNode
- Returns:
- the node type.
- See Also:
-
setNodeType
Sets the node type for this node.Sets the node type.
- Specified by:
setNodeType
in interfaceNode
- Parameters:
nodeType
- the node type for this node.- See Also:
-
getCenterX
public final int getCenterX()Getter for the field
centerX
.- 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.Sets the x coordinate of the center of this node.
- Specified by:
setCenterX
in interfaceNode
- Parameters:
centerX
- This coordinate.
-
getCenterY
public final int getCenterY()Getter for the field
centerY
.- 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.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.Sets the (x, y) coordinates of the center of this node.
-
addPropertyChangeListener
Adds a property change listener.Adds a property change listener.
- Specified by:
addPropertyChangeListener
in interfaceNode
- Parameters:
l
- This listener.
-
toString
toString.
-
hashCode
public int hashCode()hashCode.
-
equals
Tests whether this variable is equal to the given variable.Two continuous variables are equal if they have the same name and the same missing value marker.
-
like
Creates a new node of the same type as this one with the given name. -
getNodeVariableType
Returns the node shape for this node.- Specified by:
getNodeVariableType
in interfaceNode
- Returns:
- the intervention type
-
setNodeVariableType
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
getAllAttributes.
- Specified by:
getAllAttributes
in interfaceNode
- Returns:
- a
Map
object
-
getAttribute
getAttribute.
- Specified by:
getAttribute
in interfaceNode
- Parameters:
key
- aString
object- Returns:
- a
Object
object
-
removeAttribute
removeAttribute.
- Specified by:
removeAttribute
in interfaceNode
- Parameters:
key
- aString
object
-
addAttribute
addAttribute.
- Specified by:
addAttribute
in interfaceNode
- Parameters:
key
- aString
objectvalue
- aObject
object
-