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.boolean
Returns true if this node is selected as a bias 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 variablefinal void
setSelectionBias
(boolean selectionBias) Sets whether the node is selected as a bias node.toString()
toString.
-
Constructor Details
-
GraphNode
-
GraphNode
-
-
Method Details
-
serializableInstance
-
getName
-
setName
-
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
-
addPropertyChangeListener
Adds a property change listener.Adds a property change listener.
- Specified by:
addPropertyChangeListener
in interfaceNode
- Parameters:
l
- This listener.
-
toString
-
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
-
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
-
getAttribute
-
removeAttribute
removeAttribute.
- Specified by:
removeAttribute
in interfaceNode
- Parameters:
key
- aString
object
-
addAttribute
-
getSelectionBias
public boolean getSelectionBias()Returns true if this node is selected as a bias node.- Specified by:
getSelectionBias
in interfaceNode
- Returns:
- true if this node is selected as a bias node.
-
setSelectionBias
public final void setSelectionBias(boolean selectionBias) Sets whether the node is selected as a bias node.- Specified by:
setSelectionBias
in interfaceNode
- Parameters:
selectionBias
- the selection bias status for this node.
-