net.obsearch.index.bucket
Class BucketObject<O>

java.lang.Object
  extended by net.obsearch.index.bucket.BucketObject<O>
Direct Known Subclasses:
BucketObjectByte, BucketObjectDouble, BucketObjectFloat, BucketObjectInt, BucketObjectLong, BucketObjectShort

public abstract class BucketObject<O>
extends Object

BucketObject holds a bucket number for an object. Subclasses hold also the SMAP vector with the distances of the object to the pivots of a certain level.

Author:
Arnoldo Jose Muller Molina

Constructor Summary
BucketObject(long id)
          Creates a new bucket with the given bucket number and the specified level.
BucketObject(long id, O object)
          Creates a new bucket with the given bucket number and the specified level.
 
Method Summary
 long getId()
           
 O getObject()
           
abstract  int getPivotSize()
          Returns the # of pivots.
abstract  void read(ByteBuffer in, int pivots)
          Read the contents of the byte buffer into this bucket object.
 void setId(long id)
           
 void setObject(O object)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BucketObject

public BucketObject(long id)
Creates a new bucket with the given bucket number and the specified level.

Parameters:
bucket - Bucket number.
exclusionBucket - If true, the corresponding object is in the exclusion zone.
optional - id of the object.

BucketObject

public BucketObject(long id,
                    O object)
Creates a new bucket with the given bucket number and the specified level.

Parameters:
bucket - Bucket number.
exclusionBucket - If true, the corresponding object is in the exclusion zone.
optional - id of the object.
Method Detail

getObject

public O getObject()

getId

public long getId()
Returns:
the id

setObject

public void setObject(O object)

setId

public void setId(long id)
Parameters:
id - the id to set

read

public abstract void read(ByteBuffer in,
                          int pivots)
Read the contents of the byte buffer into this bucket object.

Parameters:
in - The bytes to be read.
pivots - # of pivots of the index.

getPivotSize

public abstract int getPivotSize()
Returns the # of pivots.

Returns:


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