de.aitools.aq.invertedindex.core
Class Postlist<V extends Value>

java.lang.Object
  extended by de.aitools.aq.invertedindex.core.Postlist<V>
All Implemented Interfaces:
java.lang.Iterable<V>

public class Postlist<V extends Value>
extends java.lang.Object
implements java.lang.Iterable<V>

A class of a iterable read-only postlist.

Version:
$Id: Postlist.java,v 1.1 2011/02/16 04:41:23 trenkman Exp $
Author:
martin.trenkmann@uni-weimar.de

Nested Class Summary
static class Postlist.Head
          A class representing the head of a postlist, that contains some meta-information.
 
Method Summary
 void deleteNative()
          Deletes the underlying native object.
 Postlist.Head getHead()
          Returns the Postlist.Head of this postlist with some meta information.
 boolean isEmpty()
          Checks if the postlist is empty.
 java.util.Iterator<V> iterator()
           
 void rewind()
          Set the internal iterator to the beginning.
 int size()
          Get the number of entries.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

iterator

public java.util.Iterator<V> iterator()
Specified by:
iterator in interface java.lang.Iterable<V extends Value>

deleteNative

public void deleteNative()

Deletes the underlying native object. This method has to be called if the postlist needs not to be used any longer. Please look at the usage code UsingSearcher how and when to call this method.

Remember that an instance of Postlist is always coupled with a native object that is not observed by the Java garbage collector. Forgetting this results in an out-of-memory sooner or later.


getHead

public Postlist.Head getHead()
Returns the Postlist.Head of this postlist with some meta information.

Returns:
an instance of Postlist.Head

isEmpty

public boolean isEmpty()
Checks if the postlist is empty.

Returns:
true if the postlist is empty, false otherwise.

size

public int size()
Get the number of entries.

Returns:
the number of postlist entries.

rewind

public void rewind()
Set the internal iterator to the beginning.