de.lmu.ifi.dbs.elki.evaluation.paircounting.generator
Class PairSortedGenerator

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.evaluation.paircounting.generator.PairSortedGenerator
All Implemented Interfaces:
PairSortedGeneratorInterface
Direct Known Subclasses:
PairGeneratorMerge, PairGeneratorNoise, PairGeneratorSingleCluster

public abstract class PairSortedGenerator
extends Object
implements PairSortedGeneratorInterface

Implement the common functionality of caching the current result in a base class.


Field Summary
private  IntIntPair cur
          Current pair
 
Constructor Summary
PairSortedGenerator()
           
 
Method Summary
protected abstract  IntIntPair advance()
          Main advance method.
 IntIntPair current()
          Return current pair.
 IntIntPair next()
          Return next pair.
protected  void setCurrent(IntIntPair cur)
          Set the current pair.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cur

private IntIntPair cur
Current pair

Constructor Detail

PairSortedGenerator

public PairSortedGenerator()
Method Detail

setCurrent

protected final void setCurrent(IntIntPair cur)
Set the current pair.

Parameters:
cur - new current pair.

current

public final IntIntPair current()
Return current pair. Marked as final to avoid bad implementations. If you intend to override this, just implement the interface!

Specified by:
current in interface PairSortedGeneratorInterface
Returns:
current pair, null if there are no more pairs

next

public final IntIntPair next()
Return next pair. Marked as final to avoid bad implementations. If you intend to override this, just implement the interface!

Specified by:
next in interface PairSortedGeneratorInterface
Returns:
next pair, null if there are no more pairs

advance

protected abstract IntIntPair advance()
Main advance method.


Release 0.4.0 (2011-09-20_1324)