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 TypeMethodDescriptionvoidaddAttribute(String key, Object value) addAttribute.final voidAdds a property change listener.booleanTests whether this variable is equal to the given variable.getAllAttributes.getAttribute(String key) getAttribute.final intGetter for the fieldcenterX.final intGetter for the fieldcenterY.final StringgetName()Getter for the fieldname.final NodeTypeGetter for the fieldnodeType.Returns the node shape for this node.booleanReturns true if this node is selected as a bias node.inthashCode()hashCode.Creates a new node of the same type as this one with the given name.voidremoveAttribute(String key) removeAttribute.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 node.final voidsetNodeType(NodeType nodeType) Sets the node type for this node.voidsetNodeVariableType(NodeVariableType nodeVariableType) Sets the type (domain, interventional status, interventional value..) for this node variablefinal voidsetSelectionBias(boolean selectionBias) Sets whether the node is selected as a bias node.toString()toString.
-
Constructor Details
-
Method Details
-
serializableInstance
Generates a simple exemplar of this class to test serialization.- Returns:
- a
GraphNodeobject
-
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:
getNodeTypein interfaceNode- Returns:
- the node type.
- See Also:
-
setNodeType
Sets the node type for this node.Sets the node type.
- Specified by:
setNodeTypein interfaceNode- Parameters:
nodeType- the node type for this node.- See Also:
-
getCenterX
public final int getCenterX()Getter for the field
centerX.- 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.Sets the x coordinate of the center of this node.
- Specified by:
setCenterXin interfaceNode- Parameters:
centerX- This coordinate.
-
getCenterY
public final int getCenterY()Getter for the field
centerY.- 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.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.Sets the (x, y) coordinates of the center of this node.
-
addPropertyChangeListener
Adds a property change listener.Adds a property change listener.
- Specified by:
addPropertyChangeListenerin 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:
getNodeVariableTypein interfaceNode- Returns:
- the intervention type
-
setNodeVariableType
Sets 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
getAllAttributes.
- Specified by:
getAllAttributesin interfaceNode- Returns:
- a
Mapobject
-
getAttribute
getAttribute.
- Specified by:
getAttributein interfaceNode- Parameters:
key- aStringobject- Returns:
- a
Objectobject
-
removeAttribute
removeAttribute.
- Specified by:
removeAttributein interfaceNode- Parameters:
key- aStringobject
-
addAttribute
addAttribute.
- Specified by:
addAttributein interfaceNode- Parameters:
key- aStringobjectvalue- aObjectobject
-
getSelectionBias
public boolean getSelectionBias()Returns true if this node is selected as a bias node.- Specified by:
getSelectionBiasin 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:
setSelectionBiasin interfaceNode- Parameters:
selectionBias- the selection bias status for this node.
-