org.eclipse.actf.util.comparator
Class ChainComparator

java.lang.Object
  extended by org.eclipse.actf.util.comparator.ChainComparator
All Implemented Interfaces:
Comparator<Object>

public abstract class ChainComparator
extends Object
implements Comparator<Object>

Abstract class for implementing Comparator chain.


Constructor Summary
ChainComparator()
           
 
Method Summary
 int compare(Object o1, Object o2)
           
 int intResolve(int i1, int i2)
          Return comparison result
protected abstract  int resolve(Object o1, Object o2)
          Implementations have to implement this method.
 ChainComparator setNext(ChainComparator next)
          Set next Comparator.
 
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

ChainComparator

public ChainComparator()
Method Detail

setNext

public ChainComparator setNext(ChainComparator next)
Set next Comparator.

Parameters:
next - the next Comparator
Returns:
the next Comparator

intResolve

public final int intResolve(int i1,
                            int i2)
Return comparison result

Parameters:
i1 - the target integer value 1
i2 - the target integer value 2
Returns:
a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.

resolve

protected abstract int resolve(Object o1,
                               Object o2)
Implementations have to implement this method.

Parameters:
o1 - the target Object 1
o2 - the target Object 2
Returns:
a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.

compare

public int compare(Object o1,
                   Object o2)
Specified by:
compare in interface Comparator<Object>