Package eu.bandm.tools.ops
Class RationalComparator<A>
java.lang.Object
eu.bandm.tools.ops.RationalComparator<A>
- All Implemented Interfaces:
- Comparator<A>
A cache for a given comparator, probably expensive to execute.
  It learns comparation results and
  memorizes them by mapping them to ratonal representations.
  
The current implementation uses floating point numbers and re-calculates the ratonal representations as soon as the precision is exhausted.
- 
Constructor SummaryConstructorsConstructorDescriptionRationalComparator(@Opt Comparator<? super A> base) Only constructor, setting the underlying comparator.
- 
Method SummaryMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Comparatorequals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
- 
Constructor Details- 
RationalComparatorOnly constructor, setting the underlying comparator.
 
- 
- 
Method Details- 
compareCentral sevice point: compare two objects. Both objects are first trnaslated into rational hash numbers, using the cache stores, which are then compared.- Specified by:
- comparein interface- Comparator<A>
 
- 
getCacheReturn the current mapping from domain objects to rational representations.
 
-