net.obsearch.index
Class OBVectorByte

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

public class OBVectorByte
extends Object
implements OBByte

L1 distance implementation for bytes.

Author:
Arnoldo Jose Muller Molina

Constructor Summary
OBVectorByte()
          Default constructor must be provided by every object that implements the interface OB.
OBVectorByte(byte[] data)
           
OBVectorByte(Random r, int dim)
          Creates a new vector with dim dimensions created by Random.nextByte()
 
Method Summary
 byte distance(OBByte object)
          Calculates the similarity of "this" and "object".
 boolean equals(Object o)
           
 void load(byte[] input)
           
 byte[] store()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OBVectorByte

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


OBVectorByte

public OBVectorByte(byte[] data)

OBVectorByte

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

Method Detail

equals

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

distance

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

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

load

public void load(byte[] input)
          throws net.obsearch.exception.OBException,
                 IOException
Specified by:
load in interface net.obsearch.Storable
Throws:
net.obsearch.exception.OBException
IOException

store

public byte[] store()
             throws net.obsearch.exception.OBException,
                    IOException
Specified by:
store in interface net.obsearch.Storable
Throws:
net.obsearch.exception.OBException
IOException


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