org.openwms.tms.domain.comparator
Class TransportStartComparator

java.lang.Object
  extended by org.openwms.tms.domain.comparator.TransportStartComparator
All Implemented Interfaces:
Serializable, Comparator<TransportOrder>

public class TransportStartComparator
extends Object
implements Comparator<TransportOrder>, Serializable

A TransportStartComparator. I used to sort TransportOrders is a particular order. Unfortunately some fields of the TransportOrder class are defined as Enums for a better handling in business logic. Persisting these fields as Strings makes it impossible to do a proper sorting in the database with JPA. Hence we must do it with Comparators in the application layer.

Since:
0.1
Version:
$Revision: 1583 $
Author:
Heiko Scherrer
See Also:
PriorityLevel, Serialized Form

Constructor Summary
TransportStartComparator()
           
 
Method Summary
 int compare(TransportOrder o1, TransportOrder o2)
          First the priority or orders is compared, when both are equals the id is compared too.
 
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

TransportStartComparator

public TransportStartComparator()
Method Detail

compare

public int compare(TransportOrder o1,
                   TransportOrder o2)
First the priority or orders is compared, when both are equals the id is compared too.

Specified by:
compare in interface Comparator<TransportOrder>
Parameters:
o1 - FirstOrder to compare
o2 - Second order to compare
Returns:
a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.
See Also:
Comparator.compare(java.lang.Object, java.lang.Object)


Copyright © 2005-2011 openwms.org. All Rights Reserved.