org.openbp.common.util
Class DateComparator

java.lang.Object
  extended by org.openbp.common.util.DateComparator
All Implemented Interfaces:
java.util.Comparator

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

Comparator for the date object.


Field Summary
static int[] CALENDAR_TYPES
          Mapping array for the compare elements to the calender date information
static int COMPARE_COMPLETE
          Compare all date information
static int COMPARE_DAYS
          Compare the date until the date
static int COMPARE_HOURS
          Compare the date until the hours
static int COMPARE_MINUTES
          Compare the date until the minutes
static int COMPARE_MONTH
          Compare the date until the month
static int COMPARE_YEAR
          Compare the date until the year
 
Constructor Summary
DateComparator()
          Constructor for DateComparator.
 
Method Summary
 int compare(java.lang.Object o1, java.lang.Object o2)
          Compares two dates.
static void main(java.lang.String[] args)
          Main.
 void setDateElementToCompare(int dateElement)
          Sets the date element type to compare
 
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

COMPARE_COMPLETE

public static final int COMPARE_COMPLETE
Compare all date information

See Also:
Constant Field Values

COMPARE_MINUTES

public static final int COMPARE_MINUTES
Compare the date until the minutes

See Also:
Constant Field Values

COMPARE_HOURS

public static final int COMPARE_HOURS
Compare the date until the hours

See Also:
Constant Field Values

COMPARE_DAYS

public static final int COMPARE_DAYS
Compare the date until the date

See Also:
Constant Field Values

COMPARE_MONTH

public static final int COMPARE_MONTH
Compare the date until the month

See Also:
Constant Field Values

COMPARE_YEAR

public static final int COMPARE_YEAR
Compare the date until the year

See Also:
Constant Field Values

CALENDAR_TYPES

public static final int[] CALENDAR_TYPES
Mapping array for the compare elements to the calender date information

Constructor Detail

DateComparator

public DateComparator()
Constructor for DateComparator.

Method Detail

setDateElementToCompare

public void setDateElementToCompare(int dateElement)
Sets the date element type to compare

Parameters:
dateElement - COMPARE_COMPLETE || COMPARE_MINUTES || COMPARE_HOURS || COMPARE_DAYS || COMPARE_MONTH || COMPARE_YEAR ||

compare

public int compare(java.lang.Object o1,
                   java.lang.Object o2)
Compares two dates.

Specified by:
compare in interface java.util.Comparator

main

public static void main(java.lang.String[] args)
Main.



Copyright © 2011. All Rights Reserved.