Class AbstractVariable
- All Implemented Interfaces:
- Variable,- Node,- TetradSerializable,- Serializable,- Comparable<Node>
- Direct Known Subclasses:
- ContinuousVariable,- DiscreteVariable
- Version:
- $Id: $Id
- Author:
- Willie Wheeler 7/99, josephramsey modifications 12/00
- See Also:
- 
Field SummaryFields
- 
Method SummaryModifier and TypeMethodDescriptionbooleancheckValue(Object value) Checks to see whether the passed value can be converted into a value for this variable.abstract ObjectgetMissingValueMarker.final StringgetName()Getter for the fieldname.abstract booleanisMissingValue(Object value) Tests whether the given value is the missing data marker.abstract NodeCreates a new node of the same type as this one with the given name.final voidSets the name of this node.voidsetSelectionBias(boolean selectionBias) Sets the selection bias status for this node.toString()toString.Methods inherited from class java.lang.Objectequals, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface edu.cmu.tetrad.graph.NodeaddAttribute, addPropertyChangeListener, compareTo, equals, getAllAttributes, getAttribute, getCenterX, getCenterY, getNodeType, getNodeVariableType, getSelectionBias, hashCode, removeAttribute, setCenter, setCenterX, setCenterY, setNodeType, setNodeVariableType
- 
Field Details- 
LAST_IDpublic static int LAST_IDThe last ID assigned to a variable.
 
- 
- 
Method Details- 
getMissingValueMarkergetMissingValueMarker. - Specified by:
- getMissingValueMarkerin interface- Variable
- Returns:
- the missing value marker as an Object.
 
- 
isMissingValueTests whether the given value is the missing data marker.Tests whether the given value is the missing data marker. - Specified by:
- isMissingValuein interface- Variable
- Parameters:
- value- The object value one wants to check as a missing value.
- Returns:
- true iff the given object is equals to getMissingValueMarker().
 
- 
getNameGetter for the field name.
- 
setNameSets the name of this node.Sets the name of this variable. 
- 
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. - Specified by:
- checkValuein interface- Variable
- 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.
 
- 
toStringtoString. 
- 
likeCreates a new node of the same type as this one with the given name.
- 
setSelectionBiaspublic void setSelectionBias(boolean selectionBias) Sets the selection bias status for this node.- Specified by:
- setSelectionBiasin interface- Node
- Parameters:
- selectionBias- the selection bias status for this node.
 
 
-