it.amattioli.encapsulate.dates
Class RangeEachDay

Show UML class diagram
java.lang.Object
  extended by it.amattioli.encapsulate.dates.RangeEachDay
All Implemented Interfaces:
TemporalExpression

public class RangeEachDay
extends Object
implements TemporalExpression

Check if a time point is between two hours, independently of the day. For example it can check if the time is between 09:00 AM and 06:00 PM.


Constructor Summary
RangeEachDay(int startHour, int endHour)
          Constructs an expression using the start and end hours.
RangeEachDay(int startHour, int startMinute, int endHour, int endMinute)
          Constructs an expression using the start and end hours and minutes.
 
Method Summary
 boolean includes(Date d)
          Verifies if a date satisfies this expression
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RangeEachDay

public RangeEachDay(int startHour,
                    int endHour)
Constructs an expression using the start and end hours.

Parameters:
startHour - the start hour (0 to 24)
endHour - the end hour (0 to 24)

RangeEachDay

public RangeEachDay(int startHour,
                    int startMinute,
                    int endHour,
                    int endMinute)
Constructs an expression using the start and end hours and minutes.

Parameters:
startHour - the start hour (0 to 23)
startMinute - the start minute
endHour - the end hour (0 to 24)
endMinute - the end minute
Method Detail

includes

public boolean includes(Date d)
Description copied from interface: TemporalExpression
Verifies if a date satisfies this expression

Specified by:
includes in interface TemporalExpression
Parameters:
d - the date to be checked
Returns:
true if the date satisfies this expression, false otherwise


Copyright © 2011. All Rights Reserved.