prefuse.data.util
Class SortedTupleIterator

java.lang.Object
  extended by prefuse.data.util.SortedTupleIterator
All Implemented Interfaces:
java.util.Iterator

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

Iterator that provides a sorted iteration over a set of tuples.

Author:
jeffrey heer

Constructor Summary
SortedTupleIterator(java.util.Iterator iter, java.util.Comparator c)
          Create a new SortedTupleIterator that sorts tuples in the given iterator using the given comparator.
SortedTupleIterator(java.util.Iterator iter, int size, java.util.Comparator c)
          Create a new SortedTupleIterator that sorts tuples in the given iterator using the given comparator.
 
Method Summary
 boolean hasNext()
           
 void init(java.util.Iterator iter, java.util.Comparator c)
          Initialize this iterator for the given source iterator and comparator.
 java.lang.Object next()
           
 void remove()
          Throws an UnsupportedOperationException
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SortedTupleIterator

public SortedTupleIterator(java.util.Iterator iter,
                           java.util.Comparator c)
Create a new SortedTupleIterator that sorts tuples in the given iterator using the given comparator.

Parameters:
iter - the source iterator of tuples
c - the comparator to use for sorting

SortedTupleIterator

public SortedTupleIterator(java.util.Iterator iter,
                           int size,
                           java.util.Comparator c)
Create a new SortedTupleIterator that sorts tuples in the given iterator using the given comparator.

Parameters:
iter - the source iterator of tuples
size - the expected number of tuples in the iterator
c - the comparator to use for sorting
Method Detail

init

public void init(java.util.Iterator iter,
                 java.util.Comparator c)
Initialize this iterator for the given source iterator and comparator.

Parameters:
iter - the source iterator of tuples
c - the comparator to use for sorting

hasNext

public boolean hasNext()
Specified by:
hasNext in interface java.util.Iterator
See Also:
Iterator.hasNext()

next

public java.lang.Object next()
Specified by:
next in interface java.util.Iterator
See Also:
Iterator.next()

remove

public void remove()
Throws an UnsupportedOperationException

Specified by:
remove in interface java.util.Iterator
Throws:
java.lang.UnsupportedOperationException
See Also:
Iterator.remove()


Copyright © 2007 Regents of the University of California