Venice 0.7beta

org.mov.util
Class TradingDateComparator

java.lang.Object
  extended by org.mov.util.TradingDateComparator
All Implemented Interfaces:
java.util.Comparator

public class TradingDateComparator
extends java.lang.Object
implements java.util.Comparator

A comparator for comparing TradingDate objects.


Field Summary
static int BACKWARDS
          Sort backwards
static int FORWARDS
          Sort forwards
 
Constructor Summary
TradingDateComparator(int direction)
          Create a new TradingDateComparator which sorts in the given direction.
 
Method Summary
 int compare(java.lang.Object o1, java.lang.Object o2)
          Compare the specified objects.
 boolean equals(java.lang.Object o1, java.lang.Object o2)
          Test the specified objects for equality.
 
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
 

Field Detail

FORWARDS

public static int FORWARDS
Sort forwards


BACKWARDS

public static int BACKWARDS
Sort backwards

Constructor Detail

TradingDateComparator

public TradingDateComparator(int direction)
Create a new TradingDateComparator which sorts in the given direction.

Method Detail

compare

public int compare(java.lang.Object o1,
                   java.lang.Object o2)
Compare the specified objects.

Specified by:
compare in interface java.util.Comparator
Parameters:
o1 - the first object
o2 - the second object
Returns:
0if the objects are equal; 1 if o1 is greater than o2 or -1 otherwise. If the search order is backwards this will be reversed.

equals

public boolean equals(java.lang.Object o1,
                      java.lang.Object o2)
Test the specified objects for equality.

Parameters:
o1 - the first object
o2 - the second object
Returns:
1 if the objects have the same date; 0 otherwise.

Venice 0.7beta