edu.indiana.iucbrf.feature.finiteset
Class AbstractFSMFeature

java.lang.Object
  extended by edu.indiana.iucbrf.feature.AbstractFeature
      extended by edu.indiana.iucbrf.feature.finiteset.AbstractFSMFeature
All Implemented Interfaces:
DoubleRepresentable, Feature, FSMFeature, SwingRepresentable, java.io.Serializable, java.lang.Comparable
Direct Known Subclasses:
BooleanFeature, DisplayMessageFeature, FiveSeverityFeature, PrintQualityFeature, YesNoFeature

public abstract class AbstractFSMFeature
extends AbstractFeature
implements FSMFeature

This class makes general assumptions that should be applicable for most FSMFeature implementations.

See Also:
Serialized Form

Field Summary
protected static java.lang.Class FSM_FEATURE_CLASS
           
static java.util.LinkedHashSet ONE_ANSWER_SET
           
 
Fields inherited from class edu.indiana.iucbrf.feature.AbstractFeature
DEFAULT_CONSTRUCTED, NO_STANDARD_CONSTRUCTOR, value
 
Fields inherited from interface edu.indiana.iucbrf.feature.Feature
DEFAULT_FEATURE_DIFFERENTIATORS_BY_VARTYPE, FEATURE_VALUE_FONT, INTERVAL_VARIABLE, LABEL_WIDTH, NOMINAL_VARIABLE, ORDINAL_VARIABLE, OTHER_VARIABLE
 
Fields inherited from interface edu.indiana.util.swing.SwingRepresentable
TITLE_FONT
 
Constructor Summary
protected AbstractFSMFeature()
           
  AbstractFSMFeature(Distribution distribution)
           
  AbstractFSMFeature(java.lang.Object value)
          Creates a new instance of AbstractFSMFeature
 
Method Summary
protected static java.lang.String buildSetDescription(java.util.LinkedHashSet set)
           
 java.lang.Object clone()
           
 java.lang.Object convertString(java.lang.String value)
           
static java.util.LinkedHashSet getCompleteSet(java.lang.Class featureType)
           
 double getValueAsDouble()
          Get a representation of this feature as a double.
 int getValueAsIndex()
          This method is linear in set size.
 java.lang.Object getValueCorrespondingToIndex(int index)
          This method is linear in set size.
 java.lang.Object getValueCorrespondingToIndex(java.lang.Integer index)
           
static boolean isFSMFeature(java.lang.Class aClass)
           
 boolean isValidMember(java.lang.Object value)
           
 Feature midpoint(Feature other_feature)
           
 void setValue(java.lang.Object new_value)
           
 void setValueWithDouble(double newValue)
          Set the value of this feature according to a double.
 void setValueWithIndex(int index)
          This method is linear in set size.
 int sizeOfSet()
           
 
Methods inherited from class edu.indiana.iucbrf.feature.AbstractFeature
adjust, checkAndGetDoubleValue, compareTo, equals, getValue, toString, toString, toSwing, toSwing, toSwing
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface edu.indiana.iucbrf.feature.finiteset.FSMFeature
getCompleteSet
 
Methods inherited from interface edu.indiana.iucbrf.feature.Feature
adjust, getDefaultVariableType, getValue, toString, toSwing
 
Methods inherited from interface java.lang.Comparable
compareTo
 
Methods inherited from interface edu.indiana.util.swing.SwingRepresentable
toSwing
 

Field Detail

ONE_ANSWER_SET

public static final java.util.LinkedHashSet ONE_ANSWER_SET

FSM_FEATURE_CLASS

protected static final java.lang.Class FSM_FEATURE_CLASS
Constructor Detail

AbstractFSMFeature

protected AbstractFSMFeature()

AbstractFSMFeature

public AbstractFSMFeature(java.lang.Object value)
Creates a new instance of AbstractFSMFeature


AbstractFSMFeature

public AbstractFSMFeature(Distribution distribution)
Method Detail

midpoint

public Feature midpoint(Feature other_feature)
Specified by:
midpoint in interface Feature
Specified by:
midpoint in class AbstractFeature

setValue

public void setValue(java.lang.Object new_value)
Specified by:
setValue in interface Feature

convertString

public java.lang.Object convertString(java.lang.String value)

clone

public java.lang.Object clone()
Specified by:
clone in interface Feature
Specified by:
clone in class AbstractFeature

isValidMember

public boolean isValidMember(java.lang.Object value)
Specified by:
isValidMember in interface FSMFeature

getValueAsDouble

public double getValueAsDouble()
Get a representation of this feature as a double.

Specified by:
getValueAsDouble in interface DoubleRepresentable

setValueWithDouble

public void setValueWithDouble(double newValue)
Set the value of this feature according to a double. This method is linear in set size.

Specified by:
setValueWithDouble in interface DoubleRepresentable

setValueWithIndex

public void setValueWithIndex(int index)
This method is linear in set size.

Specified by:
setValueWithIndex in interface FSMFeature

getValueAsIndex

public int getValueAsIndex()
This method is linear in set size.

Specified by:
getValueAsIndex in interface FSMFeature

sizeOfSet

public int sizeOfSet()
Specified by:
sizeOfSet in interface FSMFeature

getValueCorrespondingToIndex

public java.lang.Object getValueCorrespondingToIndex(int index)
This method is linear in set size.

Specified by:
getValueCorrespondingToIndex in interface FSMFeature

getValueCorrespondingToIndex

public java.lang.Object getValueCorrespondingToIndex(java.lang.Integer index)

buildSetDescription

protected static java.lang.String buildSetDescription(java.util.LinkedHashSet set)

isFSMFeature

public static boolean isFSMFeature(java.lang.Class aClass)

getCompleteSet

public static java.util.LinkedHashSet getCompleteSet(java.lang.Class featureType)