Class ContinuousVariable
- All Implemented Interfaces:
Variable
,Node
,TetradSerializable
,Serializable
,Comparable<Node>
- Version:
- $Id: $Id
- 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) addAttribute.void
Adds a property change listener.boolean
checkValue
(Object value) Checks to see whether the passed value can be converted into a value for this variable.boolean
Tests whether this variable is equal to the given variable.getAllAttributes.getAttribute
(String key) getAttribute.int
Getter for the fieldcenterX
.int
Getter for the fieldcenterY
.static double
getDoubleMissingValue.getMissingValueMarker.Getter for the fieldnodeType
.Returns the node shape for this node.boolean
Returns the selection bias status for this node.int
hashCode()
hashCode.static boolean
isDoubleMissingValue
(double value) Determines whether the argument is equal to the missing value marker.boolean
isMissingValue
(Object value) Tests whether the given value is the missing data marker.Creates a new node of the same type as this one with the given name.void
removeAttribute
(String key) removeAttribute.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, setSelectionBias, toString
-
Constructor Details
-
ContinuousVariable
Constructs a new continuous variable with the given name.- Parameters:
name
- the name of the variable.
-
ContinuousVariable
Copy constructor.- Parameters:
variable
- aContinuousVariable
object
-
-
Method Details
-
serializableInstance
Generates a simple exemplar of this class to test serialization.- Returns:
- a
ContinuousVariable
object
-
getDoubleMissingValue
public static double getDoubleMissingValue()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 to see whether the passed value can be converted into a value for this variable.Checks to see whether the passed value is an acceptable value for this variable. For AbstractVariable, this method always returns true. Subclasses should override checkValue() in order to provide for subclass-specific value checking. The value should pass the test if it can be converted into an equivalent object of the correct class type (see getValueClass()) for this variable; otherwise, it should fail. In general, checkValue() should not fail a value for simply not being an instance of a particular class. Since this method is not static, subclasses may (but need not) provide for instance-specific value checking.
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 object value to be checked. For instance, for a continuous variable, this would be a Double, for a discrete variable, and Integer, etc.- Returns:
- true iff the object is a valid value for this variable.
-
like
-
getMissingValueMarker
getMissingValueMarker.
- Specified by:
getMissingValueMarker
in interfaceVariable
- Specified by:
getMissingValueMarker
in classAbstractVariable
- Returns:
- the missing value marker, wrapped as a Double.
-
isMissingValue
Tests whether the given value is the missing data marker.Tests whether the given value is the missing data marker.
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 value one wants to check as a missing value.- Returns:
- true iff the given object is equals to
getMissingValueMarker()
.
-
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.
-
getNodeType
Getter for the field
nodeType
.- Specified by:
getNodeType
in interfaceNode
- Returns:
- a
NodeType
object
-
setNodeType
Sets the node type for this node.- Specified by:
setNodeType
in interfaceNode
- Parameters:
nodeType
- the node type for this node.
-
getSelectionBias
public boolean getSelectionBias()Description copied from interface:Node
Returns the selection bias status for this node.- Specified by:
getSelectionBias
in interfaceNode
- Returns:
- the selection bias status for this node.
-
getCenterX
public int getCenterX()Getter for the field
centerX
.- 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.Sets the x coordinate of the center of this node.
- Specified by:
setCenterX
in interfaceNode
- Parameters:
centerX
- This coordinate.
-
getCenterY
public int getCenterY()Getter for the field
centerY
.- 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.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.
-
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
-