pulse - the web application framework Get pulse at SourceForge.net. Fast, secure and Free Open Source software downloads Ohloh project report for pulse-java

org.torweg.pulse.component.shop.model
Class PriceComparator

java.lang.Object
  extended by org.torweg.pulse.component.shop.model.PriceComparator
All Implemented Interfaces:
java.io.Serializable, java.util.Comparator<Price>

public class PriceComparator
extends java.lang.Object
implements java.util.Comparator<Price>, java.io.Serializable

utility comparator used by ShopItem.getAvailablePrices(org.torweg.pulse.accesscontrol.User).

Version:
$Revision: 1522 $
Author:
Thomas Weber, Christian Schatt
See Also:
Serialized Form

Constructor Summary
protected PriceComparator()
          creates a new PriceComparator.
 
Method Summary
 int compare(Price p1, Price p2)
          compares the two given Prices by the minimal order size and by the net amount.
 
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

PriceComparator

protected PriceComparator()
creates a new PriceComparator.

Method Detail

compare

public final int compare(Price p1, Price p2)
compares the two given Prices by the minimal order size and by the net amount.

Specified by:
compare in interface java.util.Comparator<Price>
Parameters:
p1 - the first price
p2 - the second price
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)