prefuse.data.util
Class SortedTupleIterable<T extends Tuple<?>>

java.lang.Object
  extended by prefuse.data.util.SortedTupleIterable<T>
All Implemented Interfaces:
java.lang.Iterable<T>

public class SortedTupleIterable<T extends Tuple<?>>
extends java.lang.Object
implements java.lang.Iterable<T>

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

Author:
jeffrey heer

Constructor Summary
SortedTupleIterable(java.lang.Iterable<T> iter, java.util.Comparator<? super T> c)
          Create a new SortedTupleIterator that sorts tuples in the given iterator using the given comparator.
SortedTupleIterable(java.lang.Iterable<T> iter, int size, java.util.Comparator<? super T> c)
          Create a new SortedTupleIterator that sorts tuples in the given iterator using the given comparator.
 
Method Summary
 void init(java.lang.Iterable<T> iterable, java.util.Comparator<? super T> c)
          Initialize this iterator for the given source iterator and comparator.
 java.util.Iterator<T> iterator()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SortedTupleIterable

public SortedTupleIterable(java.lang.Iterable<T> iter,
                           java.util.Comparator<? super T> 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

SortedTupleIterable

public SortedTupleIterable(java.lang.Iterable<T> iter,
                           int size,
                           java.util.Comparator<? super T> 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.lang.Iterable<T> iterable,
                 java.util.Comparator<? super T> c)
Initialize this iterator for the given source iterator and comparator.

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

iterator

public java.util.Iterator<T> iterator()
Specified by:
iterator in interface java.lang.Iterable<T extends Tuple<?>>


Copyright © 2008 Regents of the University of California