net.obsearch.index.bucket.impl
Class BucketObjectLong<O extends OBLong>

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

public class BucketObjectLong<O extends OBLong>
extends BucketObject<O>
implements Comparable<BucketObjectLong>

BucketObjectLong 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
BucketObjectLong()
           
BucketObjectLong(long[] smapVector, long id)
          Creates a new bucket long with
BucketObjectLong(long[] smapVector, long id, O object)
          Creates a new bucket long with
 
Method Summary
 int compareTo(BucketObjectLong o)
           
static long[] convertTuple(OBLong object, OBLong[] pivots)
           
 boolean equals(Object other)
           
 int getPivotSize()
          Returns the # of pivots.
 long[] getSmapVector()
           
 long lInf(BucketObjectLong b)
          Execute l-inf between this object and b.
static long lInf(long[] smapVector, long[] other)
           
 void read(ByteBuffer in, int pivots)
          Reads the given # of pivots from the given bytebuffer.
 void setSmapVector(long[] 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

BucketObjectLong

public BucketObjectLong()

BucketObjectLong

public BucketObjectLong(long[] smapVector,
                        long id)
Creates a new bucket long 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.

BucketObjectLong

public BucketObjectLong(long[] smapVector,
                        long id,
                        O object)
Creates a new bucket long 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 long lInf(BucketObjectLong b)
Execute l-inf between this object and b.

Parameters:
b -
Returns:
l-inf

lInf

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

convertTuple

public static long[] convertTuple(OBLong object,
                                  OBLong[] pivots)
                           throws OBException
Throws:
OBException

getSmapVector

public long[] 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 BucketObject<O extends OBLong>
Parameters:
out -
pivots -

setSmapVector

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

getPivotSize

public int getPivotSize()
Description copied from class: BucketObject
Returns the # of pivots.

Specified by:
getPivotSize in class BucketObject<O extends OBLong>
Returns:

compareTo

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

toString

public String toString()
Overrides:
toString in class Object


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