org.apache.camel.processor.resequencer
Class DefaultExchangeComparator

java.lang.Object
  extended by org.apache.camel.processor.resequencer.DefaultExchangeComparator
All Implemented Interfaces:
Comparator<Exchange>, ExpressionResultComparator, SequenceElementComparator<Exchange>

public class DefaultExchangeComparator
extends Object
implements ExpressionResultComparator

Compares elements of an Exchange sequence by comparing long values returned by this comaprator's expression.

Version:

Constructor Summary
DefaultExchangeComparator()
           
 
Method Summary
 int compare(Exchange o1, Exchange o2)
           
 boolean predecessor(Exchange o1, Exchange o2)
          Returns true if o1 is an immediate predecessor of o2.
 void setExpression(Expression expression)
          Set the expression sed for comparing Exchanges.
 boolean successor(Exchange o1, Exchange o2)
          Returns true if o1 is an immediate successor of o2.
 
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

DefaultExchangeComparator

public DefaultExchangeComparator()
Method Detail

setExpression

public void setExpression(Expression expression)
Description copied from interface: ExpressionResultComparator
Set the expression sed for comparing Exchanges.

Specified by:
setExpression in interface ExpressionResultComparator
Parameters:
expression - the expression

predecessor

public boolean predecessor(Exchange o1,
                           Exchange o2)
Description copied from interface: SequenceElementComparator
Returns true if o1 is an immediate predecessor of o2.

Specified by:
predecessor in interface SequenceElementComparator<Exchange>
Parameters:
o1 - a sequence element.
o2 - a sequence element.
Returns:
true if its an immediate predecessor

successor

public boolean successor(Exchange o1,
                         Exchange o2)
Description copied from interface: SequenceElementComparator
Returns true if o1 is an immediate successor of o2.

Specified by:
successor in interface SequenceElementComparator<Exchange>
Parameters:
o1 - a sequence element.
o2 - a sequence element.
Returns:
true if its an immediate successor

compare

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


Apache CAMEL