|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.debellor.core.DataObject
public abstract class DataObject
A data object, i.e., a piece of data that can be processed by cells.
Data objects may be nested, like in DataVector
,
which contains a number of data objects and itself is a data object.
Basically, all Samples
are data objects,
which are composed of other more elementary data objects.
DataObject instances are value objects.
They are immutable, so they can be freely shared between cells
without risk of accidental modification.
They implement methods Object.equals(Object)
and Object.hashCode()
,
so they can be compared with each other and stored in collections.
Authors of new DataObject subclasses must ensure that the new classes
are immutable and correctly implement the above methods.
It is also highly recommended to override Object.toString()
to print out the value held by the data object.
The most important classes of data objects:
NumericFeature
or SymbolicFeature
.
DataVector
), usually vector of features.
Sample
Data objects represent both input data
(Sample.data
) and decisions (Sample.decision
) of samples.
Constructor Summary | |
---|---|
DataObject()
|
Method Summary | |
---|---|
DataVector |
asDataVector()
Returns this DataObject casted to DataVector . |
NumericFeature |
asNumericFeature()
Returns this DataObject casted to NumericFeature . |
SymbolicFeature |
asSymbolicFeature()
Returns this DataObject casted to SymbolicFeature . |
abstract boolean |
equals(java.lang.Object obj)
Must be implemented by every subclass. |
abstract int |
hashCode()
Must be implemented by every subclass. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DataObject()
Method Detail |
---|
public abstract boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public abstract int hashCode()
hashCode
in class java.lang.Object
public final DataVector asDataVector() throws DataCastException
DataVector
.
DataCastException
public final NumericFeature asNumericFeature() throws DataCastException
NumericFeature
.
DataCastException
public final SymbolicFeature asSymbolicFeature() throws DataCastException
SymbolicFeature
.
DataCastException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |