SuanShu, a Java numerical and statistical library

com.numericalmethod.suanshu.time
Class ComparableDateTime

java.lang.Object
  extended by com.numericalmethod.suanshu.time.ComparableDateTime
All Implemented Interfaces:
java.lang.Comparable<ComparableDateTime>

public class ComparableDateTime
extends java.lang.Object
implements java.lang.Comparable<ComparableDateTime>

A wrapper around DateTime that implements the method public int compareTo(T o);.


Constructor Summary
ComparableDateTime(org.joda.time.DateTime time)
          Construct an instance from DateTime.
ComparableDateTime(int year, int monthOfYear, int dayOfMonth, int hourOfDay, int minuteOfHour, int secondOfMinute, int millisOfSecond, org.joda.time.DateTimeZone zone)
           
 
Method Summary
 org.joda.time.DateTime asDateTime()
          Cast the instance to DateTime.
 int compareTo(ComparableDateTime that)
           
 boolean equals(java.lang.Object obj)
           
 int hashCode()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ComparableDateTime

public ComparableDateTime(org.joda.time.DateTime time)
Construct an instance from DateTime.

Parameters:
time - a DateTime

ComparableDateTime

public ComparableDateTime(int year,
                          int monthOfYear,
                          int dayOfMonth,
                          int hourOfDay,
                          int minuteOfHour,
                          int secondOfMinute,
                          int millisOfSecond,
                          org.joda.time.DateTimeZone zone)
Method Detail

compareTo

public int compareTo(ComparableDateTime that)
Specified by:
compareTo in interface java.lang.Comparable<ComparableDateTime>

asDateTime

public org.joda.time.DateTime asDateTime()
Cast the instance to DateTime.

Returns:
the representation in DateTime

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

SuanShu, a Java numerical and statistical library

Copyright © 2011 Numerical Method Inc. Ltd. All Rights Reserved.