org.debellor.core.data
Class SymbolicFeature

java.lang.Object
  extended by org.debellor.core.DataObject
      extended by org.debellor.core.data.SymbolicFeature

public final class SymbolicFeature
extends DataObject

Represents value of a symbolic feature/attribute. Internally, the value is stored as String.

Author:
Marcin Wojnarski

Nested Class Summary
static class SymbolicFeature.SymbolicFeatureType
           
 
Field Summary
 java.lang.String value
           
 
Constructor Summary
SymbolicFeature(int valueCode, DataType type)
           
SymbolicFeature(java.lang.String value)
          Constructs a SymbolicFeature with a given value.
SymbolicFeature(java.lang.String value, DataType type)
          Creates SymbolicFeature with a 'canonical' String as a symbolic value, taken from the SymbolicFeatureType object.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Must be implemented by every subclass.
 int hashCode()
          Must be implemented by every subclass.
 java.lang.String toString()
           
 
Methods inherited from class org.debellor.core.DataObject
asDataVector, asNumericFeature, asSymbolicFeature
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

value

public final java.lang.String value
Constructor Detail

SymbolicFeature

public SymbolicFeature(java.lang.String value)
Constructs a SymbolicFeature with a given value. Normally, one would create many SymbolicFeature objects with the same value in a given data stream. In such case, it is best to create all of them using the same instance of String value passed to this constructor. This increases efficiency of further comparisons of SymbolicFeature objects and decreases memory usage. If a SymbolicFeatureType object is available and contains the dictionary of all possible symbolic values, it may be convenient to use SymbolicFeature(String, DataType) constructor instead, to initialize all SymbolicFeatures with the canonical String value from the dictionary.


SymbolicFeature

public SymbolicFeature(int valueCode,
                       DataType type)
                throws DataException
Parameters:
valueCode -
type -
Throws:
DataCastException
DataException

SymbolicFeature

public SymbolicFeature(java.lang.String value,
                       DataType type)
                throws DataException
Creates SymbolicFeature with a 'canonical' String as a symbolic value, taken from the SymbolicFeatureType object.

Parameters:
value -
type - an instance of SymbolicFeatureType
Throws:
DataException
Method Detail

toString

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

equals

public boolean equals(java.lang.Object obj)
Description copied from class: DataObject
Must be implemented by every subclass.

Specified by:
equals in class DataObject

hashCode

public int hashCode()
Description copied from class: DataObject
Must be implemented by every subclass.

Specified by:
hashCode in class DataObject