net.obsearch.index.bucket.impl
Class BucketObjectShort<O extends OBShort>

java.lang.Object
  extended by net.obsearch.index.bucket.BucketObject<O>
      extended by net.obsearch.index.bucket.impl.BucketObjectShort<O>
All Implemented Interfaces:
Comparable<BucketObjectShort>

public class BucketObjectShort<O extends OBShort>
extends net.obsearch.index.bucket.BucketObject<O>
implements Comparable<BucketObjectShort>

BucketObjectShort extends BucketObject by adding an SMAP vector used to minimize the number of distance computations required per object.

Author:
Arnoldo Jose Muller Molina

Constructor Summary
BucketObjectShort()
           
BucketObjectShort(short[] smapVector, long id)
          Creates a new bucket short with
BucketObjectShort(short[] smapVector, long id, O object)
          Creates a new bucket short with
 
Method Summary
 int compareTo(BucketObjectShort o)
           
static short[] convertTuple(OBShort object, OBShort[] pivots)
           
 boolean equals(Object other)
           
 int getPivotSize()
           
 short[] getSmapVector()
           
 short lInf(BucketObjectShort b)
          Execute l-inf between this object and b.
static short lInf(short[] smapVector, short[] other)
           
 void read(ByteBuffer in, int pivots)
          Reads the given # of pivots from the given bytebuffer.
 void setSmapVector(short[] smapVector)
           
 String toString()
           
 void write(ByteBuffer out)
          Writes itself into the given data buffer.
 
Methods inherited from class net.obsearch.index.bucket.BucketObject
getId, getObject, setId, setObject
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BucketObjectShort

public BucketObjectShort()

BucketObjectShort

public BucketObjectShort(short[] smapVector,
                         long id)
Creates a new bucket short with

Parameters:
bucket - Bucket number.
level - Level within the hash table.
smapVector - The distances of the corresponding object and the pivots for the given level.
exclusionBucket - If true, the corresponding object is in the exclusion zone.
id - Optional id of the given object. Not always used.

BucketObjectShort

public BucketObjectShort(short[] smapVector,
                         long id,
                         O object)
Creates a new bucket short with

Parameters:
bucket - Bucket number.
level - Level within the hash table.
smapVector - The distances of the corresponding object and the pivots for the given level.
exclusionBucket - If true, the corresponding object is in the exclusion zone.
id - Optional id of the given object. Not always used.
Method Detail

equals

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

lInf

public short lInf(BucketObjectShort b)
Execute l-inf between this object and b.

Parameters:
b -
Returns:
l-inf

lInf

public static short lInf(short[] smapVector,
                         short[] other)

convertTuple

public static short[] convertTuple(OBShort object,
                                   OBShort[] pivots)
                            throws net.obsearch.exception.OBException
Throws:
net.obsearch.exception.OBException

getSmapVector

public short[] getSmapVector()
Returns:
the smapVector

write

public void write(ByteBuffer out)
Writes itself into the given data buffer.

Parameters:
data - The ByteBuffer that will be modified.

read

public void read(ByteBuffer in,
                 int pivots)
Reads the given # of pivots from the given bytebuffer.

Specified by:
read in class net.obsearch.index.bucket.BucketObject<O extends OBShort>
Parameters:
out -
pivots -

setSmapVector

public void setSmapVector(short[] smapVector)
Parameters:
smapVector - the smapVector to set

getPivotSize

public int getPivotSize()
Specified by:
getPivotSize in class net.obsearch.index.bucket.BucketObject<O extends OBShort>

compareTo

public int compareTo(BucketObjectShort o)
Specified by:
compareTo in interface Comparable<BucketObjectShort>

toString

public String toString()
Overrides:
toString in class Object


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