edu.indiana.iucbrf.feature.featurespec
Class FeatureSpec

java.lang.Object
  extended by edu.indiana.iucbrf.feature.featurespec.FeatureSpec
All Implemented Interfaces:
SwingRepresentable, java.io.Serializable
Direct Known Subclasses:
CCBRFeatureSpec

public class FeatureSpec
extends java.lang.Object
implements java.io.Serializable, SwingRepresentable

A FeatureSpec (feature specification) describes the general attributes of all features of a given type. For example, if cases in a system have a DoubleFeature (a feature of type double) representing current temperature, then the FeatureSpec contains the general information such as name ("temperature"), description ("The current temperature in degrees Celsius"), type (edu.indiana.iucbrf.feature.DoubleFeature), and the corresponding FeatureKey. An instance of DoubleFeature would consist primarily of the feature value (e.g. 7.3).

See Also:
Serialized Form

Field Summary
protected  java.lang.String description
           
protected  java.util.HashMap extraData
           
protected  FeatureKey featureKey
           
protected  FeatureValueFormat format
           
protected  boolean isPrintable
           
protected  boolean isSubFeature
           
static int LABEL_WIDTH
           
static int MAX_NAME_LENGTH
           
protected  java.lang.String name
           
static java.lang.Integer NUMERICAL_FEATURE_RELAXATION_AMOUNT_KEY
           
protected  java.lang.reflect.Constructor standardConstructor
           
static java.lang.Integer TABLE_FEATURE_ROWS_DATA_KEY
          Maps to a FeatureKey[].
protected  java.lang.Class type
           
 
Fields inherited from interface edu.indiana.util.swing.SwingRepresentable
TITLE_FONT
 
Constructor Summary
protected FeatureSpec()
           
  FeatureSpec(FeatureKey featureKey, java.lang.String description, java.lang.String typeName)
          Gives a default name of the first 10 characters of the description plus "...".
  FeatureSpec(FeatureKey featureKey, java.lang.String name, java.lang.String description, java.lang.String typeName)
          Creates a new instance of FeatureSpec
 
Method Summary
 boolean equals(java.lang.Object other)
           
 FeatureDifferentiator getDefaultFeatureDifferentiator()
           
 java.lang.String getDescription()
           
 java.lang.Object getExtraData(java.lang.Object extraDataKey)
           
 java.util.HashMap getExtraDataHashMap()
           
 FeatureKey getFeatureKey()
           
 FeatureValueFormat getFormat()
           
 java.lang.String getName()
           
 java.lang.reflect.Constructor getStandardConstructor()
           
 java.lang.Class getType()
           
 java.lang.String getTypeDescription()
           
 int getVariableType()
          Returns the variable type, Feature.NOMINAL_VARIABLE, Feature.ORDINAL_VARIABLE, Feature.INTERVAL_VARIABLE, or Feature.OTHER_VARIABLE.
 boolean isPrintable()
           
 boolean isSubFeature()
           
protected  void putExtraData(java.lang.Object key, java.lang.Object data)
           
protected  void setDescription(java.lang.String description)
           
protected  void setFormat(FeatureValueFormat format)
           
protected  void setIsPrintable(boolean isPrintable)
           
protected  void setIsSubFeature(boolean isSubFeature)
           
protected  void setName(java.lang.String name)
           
protected  void setStandardConstructor(java.lang.Class[] argTypes)
           
protected  void setStandardConstructor(java.lang.reflect.Constructor constructor)
           
protected  void setStandardConstructor(java.lang.String[] argTypes)
           
protected  void setType(java.lang.String typeName)
           
 java.lang.String toString()
           
 javax.swing.JComponent toSwing(int detailLevel)
          Detail level may be ignored by implementations.
protected  javax.swing.JComponent toSwingHelper(int numberOfSlots)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TABLE_FEATURE_ROWS_DATA_KEY

public static final java.lang.Integer TABLE_FEATURE_ROWS_DATA_KEY
Maps to a FeatureKey[].


NUMERICAL_FEATURE_RELAXATION_AMOUNT_KEY

public static final java.lang.Integer NUMERICAL_FEATURE_RELAXATION_AMOUNT_KEY

LABEL_WIDTH

public static final int LABEL_WIDTH
See Also:
Constant Field Values

MAX_NAME_LENGTH

public static final int MAX_NAME_LENGTH
See Also:
Constant Field Values

extraData

protected java.util.HashMap extraData

name

protected java.lang.String name

description

protected java.lang.String description

type

protected java.lang.Class type

featureKey

protected FeatureKey featureKey

format

protected FeatureValueFormat format

isPrintable

protected boolean isPrintable

isSubFeature

protected boolean isSubFeature

standardConstructor

protected java.lang.reflect.Constructor standardConstructor
Constructor Detail

FeatureSpec

protected FeatureSpec()

FeatureSpec

public FeatureSpec(FeatureKey featureKey,
                   java.lang.String description,
                   java.lang.String typeName)
Gives a default name of the first 10 characters of the description plus "...".


FeatureSpec

public FeatureSpec(FeatureKey featureKey,
                   java.lang.String name,
                   java.lang.String description,
                   java.lang.String typeName)
Creates a new instance of FeatureSpec

Method Detail

setStandardConstructor

protected void setStandardConstructor(java.lang.Class[] argTypes)

setStandardConstructor

protected void setStandardConstructor(java.lang.String[] argTypes)

setStandardConstructor

protected void setStandardConstructor(java.lang.reflect.Constructor constructor)

getStandardConstructor

public java.lang.reflect.Constructor getStandardConstructor()

isPrintable

public boolean isPrintable()

setIsPrintable

protected void setIsPrintable(boolean isPrintable)

isSubFeature

public boolean isSubFeature()

setIsSubFeature

protected void setIsSubFeature(boolean isSubFeature)

putExtraData

protected void putExtraData(java.lang.Object key,
                            java.lang.Object data)

getExtraData

public java.lang.Object getExtraData(java.lang.Object extraDataKey)

getExtraDataHashMap

public java.util.HashMap getExtraDataHashMap()

getFormat

public FeatureValueFormat getFormat()

setFormat

protected void setFormat(FeatureValueFormat format)

getName

public java.lang.String getName()

setName

protected void setName(java.lang.String name)

getDescription

public java.lang.String getDescription()

setDescription

protected void setDescription(java.lang.String description)

getType

public java.lang.Class getType()

setType

protected void setType(java.lang.String typeName)

getVariableType

public int getVariableType()
Returns the variable type, Feature.NOMINAL_VARIABLE, Feature.ORDINAL_VARIABLE, Feature.INTERVAL_VARIABLE, or Feature.OTHER_VARIABLE.


getDefaultFeatureDifferentiator

public FeatureDifferentiator getDefaultFeatureDifferentiator()

getFeatureKey

public FeatureKey getFeatureKey()

equals

public boolean equals(java.lang.Object other)
Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

toSwing

public javax.swing.JComponent toSwing(int detailLevel)
Description copied from interface: SwingRepresentable
Detail level may be ignored by implementations. If used, the standard is for detailLevel 0 to be least detail, with higher values growing more detailed. 0 is least detail, higher numbers are more

Specified by:
toSwing in interface SwingRepresentable

getTypeDescription

public java.lang.String getTypeDescription()

toSwingHelper

protected javax.swing.JComponent toSwingHelper(int numberOfSlots)