List of usage examples for org.jfree.data.time Hour getDay
public Day getDay()
From source file:org.jfree.data.time.Hour.java
/** * Returns an integer indicating the order of this Hour object relative to * the specified object:/*from w ww .j a va 2 s. c o m*/ * * negative == before, zero == same, positive == after. * * @param o1 the object to compare. * * @return negative == before, zero == same, positive == after. */ @Override public int compareTo(Object o1) { int result; // CASE 1 : Comparing to another Hour object // ----------------------------------------- if (o1 instanceof Hour) { Hour h = (Hour) o1; result = getDay().compareTo(h.getDay()); if (result == 0) { result = this.hour - h.getHour(); } } // CASE 2 : Comparing to another TimePeriod object // ----------------------------------------------- else if (o1 instanceof RegularTimePeriod) { // more difficult case - evaluate later... result = 0; } // CASE 3 : Comparing to a non-TimePeriod object // --------------------------------------------- else { // consider time periods to be ordered after general objects result = 1; } return result; }
From source file:org.jfree.data.time.Minute.java
/** * Constructs a new Minute./* ww w.j a va2 s.co m*/ * * @param minute the minute (0 to 59). * @param hour the hour (<code>null</code> not permitted). */ public Minute(int minute, Hour hour) { ParamChecks.nullNotPermitted(hour, "hour"); this.minute = (byte) minute; this.hour = (byte) hour.getHour(); this.day = hour.getDay(); peg(Calendar.getInstance()); }