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 SummaryFields inherited from class edu.cmu.tetrad.data.AbstractVariableLAST_ID
- 
Constructor SummaryConstructorsConstructorDescriptionContinuousVariable(ContinuousVariable variable) Copy constructor.ContinuousVariable(String name) Constructs a new continuous variable with the given name.
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddAttribute(String key, Object value) addAttribute.voidAdds a property change listener.booleancheckValue(Object value) Checks to see whether the passed value can be converted into a value for this variable.booleanTests whether this variable is equal to the given variable.getAllAttributes.getAttribute(String key) getAttribute.intGetter for the fieldcenterX.intGetter for the fieldcenterY.static doublegetDoubleMissingValue.getMissingValueMarker.Getter for the fieldnodeType.Returns the node shape for this node.booleanReturns the selection bias status for this node.inthashCode()hashCode.static booleanisDoubleMissingValue(double value) Determines whether the argument is equal to the missing value marker.booleanisMissingValue(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.voidremoveAttribute(String key) removeAttribute.static ContinuousVariableGenerates a simple exemplar of this class to test serialization.voidsetCenter(int centerX, int centerY) Sets the (x, y) coordinates of the center of this node.voidsetCenterX(int centerX) Sets the x coordinate of the center of this node.voidsetCenterY(int centerY) Sets the y coordinate of the center of this node.voidsetNodeType(NodeType nodeType) Sets the node type for this node.voidsetNodeVariableType(NodeVariableType nodeVariableType) Sets the type (domain, interventional status, interventional value..) for this node variableMethods inherited from class edu.cmu.tetrad.data.AbstractVariablegetName, setName, setSelectionBias, toString
- 
Constructor Details- 
ContinuousVariableConstructs a new continuous variable with the given name.- Parameters:
- name- the name of the variable.
 
- 
ContinuousVariableCopy constructor.- Parameters:
- variable- a- ContinuousVariableobject
 
 
- 
- 
Method Details- 
serializableInstanceGenerates a simple exemplar of this class to test serialization.- Returns:
- a ContinuousVariableobject
 
- 
getDoubleMissingValuepublic static double getDoubleMissingValue()getDoubleMissingValue. - Returns:
- the missing value marker.
 
- 
isDoubleMissingValuepublic 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.
 
- 
checkValueChecks 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:
- checkValuein interface- Variable
- Overrides:
- checkValuein class- AbstractVariable
- 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.
 
- 
likeCreates a new node of the same type as this one with the given name.- Specified by:
- likein interface- Node
- Specified by:
- likein class- AbstractVariable
- Parameters:
- name- the name of the new node.
- Returns:
- the new node.
 
- 
getMissingValueMarkergetMissingValueMarker. - Specified by:
- getMissingValueMarkerin interface- Variable
- Specified by:
- getMissingValueMarkerin class- AbstractVariable
- Returns:
- the missing value marker, wrapped as a Double.
 
- 
isMissingValueTests 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:
- isMissingValuein interface- Variable
- Specified by:
- isMissingValuein class- AbstractVariable
- Parameters:
- value- The object value one wants to check as a missing value.
- Returns:
- true iff the given object is equals to getMissingValueMarker().
 
- 
hashCodepublic int hashCode()hashCode. 
- 
equalsTests 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. 
- 
getNodeTypeGetter for the field nodeType.- Specified by:
- getNodeTypein interface- Node
- Returns:
- a NodeTypeobject
 
- 
setNodeTypeSets the node type for this node.- Specified by:
- setNodeTypein interface- Node
- Parameters:
- nodeType- the node type for this node.
 
- 
getSelectionBiaspublic boolean getSelectionBias()Description copied from interface:NodeReturns the selection bias status for this node.- Specified by:
- getSelectionBiasin interface- Node
- Returns:
- the selection bias status for this node.
 
- 
getCenterXpublic int getCenterX()Getter for the field centerX.- Specified by:
- getCenterXin interface- Node
- Returns:
- the x coordinate of the center of the node.
 
- 
setCenterXpublic 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 interface- Node
- Parameters:
- centerX- This coordinate.
 
- 
getCenterYpublic int getCenterY()Getter for the field centerY.- Specified by:
- getCenterYin interface- Node
- Returns:
- the y coordinate of the center of the node.
 
- 
setCenterYpublic 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 interface- Node
- Parameters:
- centerY- This coordinate.
 
- 
setCenterpublic 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. 
- 
addPropertyChangeListenerAdds a property change listener.Adds a property change listener. - Specified by:
- addPropertyChangeListenerin interface- Node
- Parameters:
- l- This listener.
 
- 
getNodeVariableTypeReturns the node shape for this node.- Specified by:
- getNodeVariableTypein interface- Node
- Returns:
- the intervention type
 
- 
setNodeVariableTypeSets the type (domain, interventional status, interventional value..) for this node variable- Specified by:
- setNodeVariableTypein interface- Node
- Parameters:
- nodeVariableType- the type (domain, interventional status, interventional value..) for this node variable
 
- 
getAllAttributesgetAllAttributes. - Specified by:
- getAllAttributesin interface- Node
- Returns:
- a Mapobject
 
- 
getAttributegetAttribute. - Specified by:
- getAttributein interface- Node
- Parameters:
- key- a- Stringobject
- Returns:
- a Objectobject
 
- 
removeAttributeremoveAttribute. - Specified by:
- removeAttributein interface- Node
- Parameters:
- key- a- Stringobject
 
- 
addAttributeaddAttribute. - Specified by:
- addAttributein interface- Node
- Parameters:
- key- a- Stringobject
- value- a- Objectobject
 
 
-