org.hackystat.utilities.time.interval
Class Interval

java.lang.Object
  extended by org.hackystat.utilities.time.interval.Interval
Direct Known Subclasses:
DayInterval, MonthInterval, WeekInterval

public abstract class Interval
extends java.lang.Object

Provides a general interval type.

Author:
Hongbing Kou

Constructor Summary
Interval(java.lang.String intervalType)
          Instantiates an interval object.
 
Method Summary
 java.lang.String getIntervalType()
          Gets interval type.
 boolean isDailyInterval()
          Whether this interval is a daily interval type.
 boolean isMonthlyInterval()
          Whether this interval is a month interval type.
 boolean isWeeklyInterval()
          Whether this interval is a week interval type.
abstract  java.util.Iterator<?> iterator()
          Gets iterator over the interval.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Interval

public Interval(java.lang.String intervalType)
Instantiates an interval object.

Parameters:
intervalType - Interval name.
Method Detail

getIntervalType

public java.lang.String getIntervalType()
Gets interval type.

Returns:
Interval type.

iterator

public abstract java.util.Iterator<?> iterator()
Gets iterator over the interval.

Returns:
Iterator over the interval.

isDailyInterval

public boolean isDailyInterval()
Whether this interval is a daily interval type.

Returns:
True if so and false otherwise.

isWeeklyInterval

public boolean isWeeklyInterval()
Whether this interval is a week interval type.

Returns:
True if so and false otherwise.

isMonthlyInterval

public boolean isMonthlyInterval()
Whether this interval is a month interval type.

Returns:
True if so and false otherwise.