Mobios v0.91

mobios.type
Class DoubleVector

java.lang.Object
  extended by mobios.type.IndexObject
      extended by mobios.type.DoubleVector
All Implemented Interfaces:
Externalizable, Serializable, Comparable<IndexObject>
Direct Known Subclasses:
Spectra

public class DoubleVector
extends IndexObject

This class represents space vectors, where each element is a double.

Version:
2003.06.06
Author:
Rui Mao, Willard
See Also:
Serialized Form

Constructor Summary
DoubleVector()
          TODO
DoubleVector(mobios.db.Table table, int rowID, double[] data)
          Builds an instance from a double array.
DoubleVector(mobios.db.Table table, int rowID, String dataString)
          Builds an instance from a space-separated String of doubles.
 
Method Summary
 int compareTo(DoubleVector oThat)
           
 int compareTo(IndexObject oThat)
           
 boolean equals(Object that)
           
 IndexObject[] expand()
          This method is necessary to implement bucketing, so that similar objects are only stored once in the database.
 double[] getData()
           
 int hashCode()
           
 void readExternal(ObjectInput in)
           
 int size()
           
 String toString()
          all implementing classes are required to override toString
 void writeExternal(ObjectOutput out)
           
 
Methods inherited from class mobios.type.IndexObject
getRowID, setRowID, setRowIDLength
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DoubleVector

public DoubleVector()
TODO


DoubleVector

public DoubleVector(mobios.db.Table table,
                    int rowID,
                    String dataString)
Builds an instance from a space-separated String of doubles.

Parameters:
table -
rowID -
dataString -

DoubleVector

public DoubleVector(mobios.db.Table table,
                    int rowID,
                    double[] data)
Builds an instance from a double array.

Parameters:
rowID -
data - the double array containning all the elements. cannot be null
Method Detail

getData

public double[] getData()
Returns:
the double array

size

public int size()
Specified by:
size in class IndexObject
Returns:
the dimension ( length) of the vector

expand

public IndexObject[] expand()
Description copied from class: IndexObject
This method is necessary to implement bucketing, so that similar objects are only stored once in the database. If you do not want to implement bucketing for your object, you can just return an array of length one containing this object.

Specified by:
expand in class IndexObject
Returns:
an array of IndexObjects

compareTo

public int compareTo(IndexObject oThat)
Specified by:
compareTo in interface Comparable<IndexObject>
Specified by:
compareTo in class IndexObject

compareTo

public int compareTo(DoubleVector oThat)
Parameters:
oThat -
Returns:

equals

public boolean equals(Object that)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Description copied from class: IndexObject
all implementing classes are required to override toString

Specified by:
toString in class IndexObject

readExternal

public void readExternal(ObjectInput in)
                  throws IOException,
                         ClassNotFoundException
Specified by:
readExternal in interface Externalizable
Overrides:
readExternal in class IndexObject
Throws:
IOException
ClassNotFoundException

writeExternal

public void writeExternal(ObjectOutput out)
                   throws IOException
Specified by:
writeExternal in interface Externalizable
Overrides:
writeExternal in class IndexObject
Throws:
IOException

Mobios v0.91

(C) 2002 - 2006 The MoBIoS Group