com.sun.labs.minion.indexer.partition
Class FieldIterator

java.lang.Object
  extended by com.sun.labs.minion.indexer.partition.FieldIterator
All Implemented Interfaces:
java.util.Iterator

public class FieldIterator
extends java.lang.Object
implements java.util.Iterator

A class that will iterate through all of the saved values in a set of partitions for a given field.


Nested Class Summary
protected  class FieldIterator.HE
          An element to put on the heap.
 
Field Summary
protected  int freq
          Used to store the frequency of the current field returned by "next()"
protected  java.util.PriorityQueue<FieldIterator.HE> h
          A heap holding the individual iterators.
 
Constructor Summary
FieldIterator(java.util.List parts, java.lang.String field, boolean ignoreCase)
          Creates an iterator for all of the unique field values in the given partitions.
 
Method Summary
 int getFreq()
           
 boolean hasNext()
          Indicates whether there is another field value to return.
 java.lang.Object next()
          Gets the next field value.
 void remove()
          Unsupported operation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

h

protected java.util.PriorityQueue<FieldIterator.HE> h
A heap holding the individual iterators.


freq

protected int freq
Used to store the frequency of the current field returned by "next()"

Constructor Detail

FieldIterator

public FieldIterator(java.util.List parts,
                     java.lang.String field,
                     boolean ignoreCase)
Creates an iterator for all of the unique field values in the given partitions.

Parameters:
parts - The partitions from which we'll draw field values.
field - The field whose values we want to iterate through.
Method Detail

remove

public void remove()
Unsupported operation.

Specified by:
remove in interface java.util.Iterator

next

public java.lang.Object next()
Gets the next field value. The field values are returned in increasing order, depending on the field type.

Specified by:
next in interface java.util.Iterator
Returns:
The next field value.

getFreq

public int getFreq()

hasNext

public boolean hasNext()
Indicates whether there is another field value to return.

Specified by:
hasNext in interface java.util.Iterator
Returns:
true if there is another value to return, false otherwise.