Spring Integration

org.springframework.integration.aggregator
Class SequenceNumberComparator

java.lang.Object
  extended by org.springframework.integration.aggregator.SequenceNumberComparator
All Implemented Interfaces:
java.util.Comparator<Message<?>>

public class SequenceNumberComparator
extends java.lang.Object
implements java.util.Comparator<Message<?>>

Since:
2.0
Author:
Dave Syer

Constructor Summary
SequenceNumberComparator()
           
 
Method Summary
 int compare(Message<?> o1, Message<?> o2)
          If both messages have a sequence number then compare that, otherwise if one has a sequence number and the other doesn't then the numbered message comes first, or finally of neither has a sequence number then they are equal in rank.
 
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

SequenceNumberComparator

public SequenceNumberComparator()
Method Detail

compare

public int compare(Message<?> o1,
                   Message<?> o2)
If both messages have a sequence number then compare that, otherwise if one has a sequence number and the other doesn't then the numbered message comes first, or finally of neither has a sequence number then they are equal in rank.

Specified by:
compare in interface java.util.Comparator<Message<?>>

Spring Integration