org.debellor.core
Class DataObject

java.lang.Object
  extended by org.debellor.core.DataObject
Direct Known Subclasses:
DataVector, NumericFeature, Sample, SymbolicFeature

public abstract class DataObject
extends java.lang.Object

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:

In the future: images, time series, special types of decisions, ...

Data objects represent both input data (Sample.data) and decisions (Sample.decision) of samples.

Author:
Marcin Wojnarski

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

DataObject

public DataObject()
Method Detail

equals

public abstract boolean equals(java.lang.Object obj)
Must be implemented by every subclass.

Overrides:
equals in class java.lang.Object

hashCode

public abstract int hashCode()
Must be implemented by every subclass.

Overrides:
hashCode in class java.lang.Object

asDataVector

public final DataVector asDataVector()
                              throws DataCastException
Returns this DataObject casted to DataVector.

Throws:
DataCastException

asNumericFeature

public final NumericFeature asNumericFeature()
                                      throws DataCastException
Returns this DataObject casted to NumericFeature.

Throws:
DataCastException

asSymbolicFeature

public final SymbolicFeature asSymbolicFeature()
                                        throws DataCastException
Returns this DataObject casted to SymbolicFeature.

Throws:
DataCastException