net.obsearch.index
Class OBVectorShort

java.lang.Object
  extended by net.obsearch.index.OBVectorShort
All Implemented Interfaces:
OB, OBShort, Storable

public class OBVectorShort
extends Object
implements OBShort

L1 distance implementation for shorts.

Author:
Arnoldo Jose Muller Molina

Constructor Summary
OBVectorShort()
          Default constructor must be provided by every object that implements the interface OB.
OBVectorShort(Random r, int dim)
          Creates a new vector with dim dimensions created by Random.nextShort()
OBVectorShort(short[] data)
           
 
Method Summary
 short distance(OBShort object)
          Calculates the similarity of "this" and "object".
 boolean equals(Object o)
           
 void load(byte[] input)
          Populates the object's internal properties from the given byte stream.
 byte[] store()
          Stores this object in a byte array.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OBVectorShort

public OBVectorShort()
Default constructor must be provided by every object that implements the interface OB.


OBVectorShort

public OBVectorShort(short[] data)

OBVectorShort

public OBVectorShort(Random r,
                     int dim)
Creates a new vector with dim dimensions created by Random.nextShort()

Method Detail

equals

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

distance

public short distance(OBShort object)
               throws OBException
Description copied from interface: OBShort
Calculates the similarity of "this" and "object". The function must satisfy the triangular inequality and return a short.

Specified by:
distance in interface OBShort
Parameters:
object - The object of type OBShort to be compared
Throws:
OBException - User generated exception

load

public void load(byte[] input)
          throws OBException,
                 IOException
Description copied from interface: Storable
Populates the object's internal properties from the given byte stream.

Specified by:
load in interface Storable
Parameters:
input - byte array from where we will load data.
Throws:
OBException - if the data cannot be loaded.
IOException

store

public byte[] store()
             throws OBException,
                    IOException
Description copied from interface: Storable
Stores this object in a byte array.

Specified by:
store in interface Storable
Throws:
OBException
IOException


Copyright © 2007-2011 Arnoldo Jose Muller Molina. All Rights Reserved.