net.obsearch
Class AbstractOBResult<O>

java.lang.Object
  extended by net.obsearch.AbstractOBResult<O>
Type Parameters:
O - The object that was added into the result.
All Implemented Interfaces:
Comparable
Direct Known Subclasses:
OBResultByte, OBResultDouble, OBResultFloat, OBResultInt, OBResultInvertedByte, OBResultInvertedDouble, OBResultInvertedFloat, OBResultInvertedInt, OBResultInvertedLong, OBResultInvertedShort, OBResultLong, OBResultShort

public abstract class AbstractOBResult<O>
extends Object
implements Comparable

Holds a match result. It includes the object matched, its internal id and subclasses of this class will hold the distance value. WARNING: The internal id held in this class does not make sense in a P2P environment.

Since:
0.7
Author:
Arnoldo Jose Muller Molina

Field Summary
protected  long id
          Its internal id.
protected  O object
          The object to be stored.
 
Constructor Summary
AbstractOBResult()
          Default constructor.
AbstractOBResult(O object, long id)
          Creates a new result with the given object and id.
 
Method Summary
 long getId()
           
 O getObject()
           
 void setId(long id)
          Sets the internal id of the result.
 void setObject(O obj)
          Sets the object of the result.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Field Detail

object

protected O object
The object to be stored.


id

protected long id
Its internal id.

Constructor Detail

AbstractOBResult

public AbstractOBResult()
Default constructor.


AbstractOBResult

public AbstractOBResult(O object,
                        long id)
Creates a new result with the given object and id.

Parameters:
object - The object to be stored in the result.
id - The internal id of the object.
Method Detail

getObject

public final O getObject()
Returns:
The object of the result.

setObject

public final void setObject(O obj)
Sets the object of the result.

Parameters:
obj -

getId

public final long getId()
Returns:
The internal id of the result. (Not useful in P2P mode)

setId

public final void setId(long id)
Sets the internal id of the result.

Parameters:
id - The identification number of this result's object.


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