com.sun.labs.minion.retrieval
Class ArrayGroup.DocIterator

java.lang.Object
  extended by com.sun.labs.minion.retrieval.ArrayGroup.DocIterator
All Implemented Interfaces:
ResultAccessor, java.lang.Comparable<ArrayGroup.DocIterator>
Direct Known Subclasses:
NegativeGroup.NegativeDocIterator, ScoredGroup.ScoredDocIterator
Enclosing class:
ArrayGroup

public class ArrayGroup.DocIterator
extends java.lang.Object
implements java.lang.Comparable<ArrayGroup.DocIterator>, ResultAccessor

A class that provides an iterator for the documents in this group.


Constructor Summary
ArrayGroup.DocIterator()
           
 
Method Summary
 int compareTo(ArrayGroup.DocIterator o)
          Compares this iterator to another.
 int getDoc()
          Gets the document at the head of the iterator.
 java.util.List<java.lang.Object> getField(java.lang.String field)
          Gets the values associated with the given saved field for the current result
 java.util.List<java.lang.Object> getField(java.lang.String field, java.util.List<java.lang.Object> l)
           
 java.lang.String getKey()
          Gets the key of the result under consideration
 DiskPartition getPart()
          Gets the partition associated with this array group.
 float getScore()
          Gets the score at the head of the iterator.
 java.lang.Object getSingleFieldValue(java.lang.String field)
          Gets a single value for the given saved field for the current result
 boolean next()
          Advance to the next position, skipping deleted documents.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArrayGroup.DocIterator

public ArrayGroup.DocIterator()
Method Detail

next

public boolean next()
Advance to the next position, skipping deleted documents.

Returns:
true if there is a next position, false otherwise.

getDoc

public int getDoc()
Gets the document at the head of the iterator.


getScore

public float getScore()
Gets the score at the head of the iterator. In this case, always returns 1.

Specified by:
getScore in interface ResultAccessor

getPart

public DiskPartition getPart()
Gets the partition associated with this array group.


compareTo

public int compareTo(ArrayGroup.DocIterator o)
Compares this iterator to another. The comparison is done by document ID.

Specified by:
compareTo in interface java.lang.Comparable<ArrayGroup.DocIterator>

getKey

public java.lang.String getKey()
Description copied from interface: ResultAccessor
Gets the key of the result under consideration

Specified by:
getKey in interface ResultAccessor
Returns:
the key of the current result

getField

public java.util.List<java.lang.Object> getField(java.lang.String field)
Description copied from interface: ResultAccessor
Gets the values associated with the given saved field for the current result

Specified by:
getField in interface ResultAccessor
Parameters:
field - the field whose values we want
Returns:
the values for this field. If the current result does not have any saved values for this field, an empty list will be returned.

getField

public java.util.List<java.lang.Object> getField(java.lang.String field,
                                                 java.util.List<java.lang.Object> l)

getSingleFieldValue

public java.lang.Object getSingleFieldValue(java.lang.String field)
Description copied from interface: ResultAccessor
Gets a single value for the given saved field for the current result

Specified by:
getSingleFieldValue in interface ResultAccessor
Parameters:
field - the field whose value we want
Returns:
the field value for the current result, or null if this result does not have a value saved for this field