org.debellor.core.data
Class DataVector

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

public final class DataVector
extends DataObject

Represents vectors of data items of different types. Vectors can have fixed or variable length.

Author:
Marcin Wojnarski

Nested Class Summary
static class DataVector.DataVectorType
          dataType of DataVector.
 
Constructor Summary
DataVector(DataObject... items)
          Constructs a new DataVector containing the items passed as an array or a variable-length list of DataObjects.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Must be implemented by every subclass.
 DataObject[] get()
          Returns a shallow copy> of the array of items of this DataVector.
 DataObject get(int i)
           
 int hashCode()
          Must be implemented by every subclass.
 boolean isMissing(int i)
           
 int size()
           
 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
 

Constructor Detail

DataVector

public DataVector(DataObject... items)
Constructs a new DataVector containing the items passed as an array or a variable-length list of DataObjects.

Method Detail

size

public int size()

isMissing

public boolean isMissing(int i)

get

public DataObject get(int i)

get

public DataObject[] get()
Returns a shallow copy> of the array of items of this DataVector. Since this method allocates a new array, if only read access to items is needed and the array of items is not going to be modified, it is recommended to use get(int) method instead, which does not allocate new resources. Here, the existing array could not be returned, as this would violate immutability of data objects (the returned array could be modified afterwards, which would indirectly modify this DataVector object).


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