net.ontopia.utils
Class IteratorComparator<T>

java.lang.Object
  extended by net.ontopia.utils.IteratorComparator<T>
All Implemented Interfaces:
Comparator<Iterator<T>>

public class IteratorComparator<T>
extends Object
implements Comparator<Iterator<T>>

INTERNAL: Comparator for Iterators. Compares each element in turn until the end of one Iterator is reached. Then, if one Iterator contains fewer elements than the other, it is ordered first.


Constructor Summary
IteratorComparator(Comparator<T> elementComparator)
           
 
Method Summary
 int compare(Iterator<T> it1, Iterator<T> it2)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Constructor Detail

IteratorComparator

public IteratorComparator(Comparator<T> elementComparator)
Method Detail

compare

public int compare(Iterator<T> it1,
                   Iterator<T> it2)
Specified by:
compare in interface Comparator<Iterator<T>>


Copyright © 2000-2012 Ontopia.