Package edu.cmu.tetrad.data
Class ContinuousVariable
java.lang.Object
edu.cmu.tetrad.data.AbstractVariable
edu.cmu.tetrad.data.ContinuousVariable
- All Implemented Interfaces:
Variable
,Node
,TetradSerializable
,Serializable
,Comparable<Node>
Represents a real-valued variable. The values are doubles, and the default missing value marker for is Double.NaN.
- Author:
- Willie Wheeler 07/99, josephramsey modifications 12/00
- See Also:
-
Field Summary
Fields inherited from class edu.cmu.tetrad.data.AbstractVariable
LAST_ID
-
Constructor Summary
ConstructorsConstructorDescriptionContinuousVariable
(ContinuousVariable variable) Copy constructor.ContinuousVariable
(String name) Constructs a new continuous variable with the given name. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAttribute
(String key, Object value) void
Adds a property change listener.boolean
checkValue
(Object value) Checks the value to make sure it's a legitimate value for this column.boolean
Two continuous variables are equal if they have the same name and the same missing value marker.getAttribute
(String key) int
Returns the x coordinate of the center of this node.int
Returns the y coordinate of the center of this node.static double
Returns the name of the variable.Returns the node type for this node.Returns the node shape for this node.int
hashCode()
Removes a property change listener.static boolean
isDoubleMissingValue
(double value) Determines whether the argument is equal to the missing value marker.boolean
isMissingValue
(Object value) Determines whether the argument is equal to the missing value marker.Creates a new node of the same type as this one with the given name.void
removeAttribute
(String key) static ContinuousVariable
Generates a simple exemplar of this class to test serialization.void
setCenter
(int centerX, int centerY) Sets the (x, y) coordinates of the center of this node.void
setCenterX
(int centerX) Sets the x coordinate of the center of this node.void
setCenterY
(int centerY) Sets the y coordinate of the center of this node.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 variableMethods inherited from class edu.cmu.tetrad.data.AbstractVariable
getName, setName, toString
-
Constructor Details
-
ContinuousVariable
Constructs a new continuous variable with the given name.- Parameters:
name
- the name of the variable.
-
ContinuousVariable
Copy constructor.
-
-
Method Details
-
serializableInstance
Generates a simple exemplar of this class to test serialization. -
getDoubleMissingValue
public static double getDoubleMissingValue()- Returns:
- the missing value marker.
-
isDoubleMissingValue
public static boolean isDoubleMissingValue(double value) Determines whether the argument is equal to the missing value marker.- Parameters:
value
- the Object to test--should be a wrapped version of the missing value marker.- Returns:
- true iff it really is a wrapped version of the missing value marker.
-
checkValue
Checks the value to make sure it's a legitimate value for this column.- Specified by:
checkValue
in interfaceVariable
- Overrides:
checkValue
in classAbstractVariable
- Parameters:
value
- the value to check.- Returns:
- true iff the value is legitimate.
-
like
Description copied from interface:Node
Creates a new node of the same type as this one with the given name.- Specified by:
like
in interfaceNode
- Specified by:
like
in classAbstractVariable
- Parameters:
name
- the name of the new node.- Returns:
- the new node.
-
getMissingValueMarker
Description copied from interface:Variable
Returns the name of the variable.- Specified by:
getMissingValueMarker
in interfaceVariable
- Specified by:
getMissingValueMarker
in classAbstractVariable
- Returns:
- the missing value marker, wrapped as a Double.
-
isMissingValue
Determines whether the argument is equal to the missing value marker.- Specified by:
isMissingValue
in interfaceVariable
- Specified by:
isMissingValue
in classAbstractVariable
- Parameters:
value
- the Object to test--should be a wrapped version of the missing value marker.- Returns:
- true iff it really is a wrapped version of the missing value marker.
-
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. -
getNodeType
Description copied from interface:Node
Returns the node type for this node.- Specified by:
getNodeType
in interfaceNode
- Returns:
- the node type for this node.
-
setNodeType
Description copied from interface:Node
Sets the node type for this node.- Specified by:
setNodeType
in interfaceNode
- Parameters:
nodeType
- the node type for this node.
-
getCenterX
public 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 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 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 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 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.
-
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
-