it.amattioli.encapsulate.dates
Interface TimeInterval

Show UML class diagram
All Superinterfaces:
Range<Date>
All Known Implementing Classes:
ConventionalTimeInterval, Day, GenericTimeInterval, Hour, Month, QuarterOfDay, Week, Year

public interface TimeInterval
extends Range<Date>

A range extension that represents a time interval.


Method Summary
 boolean after(TimeInterval other)
          Verifies if another time interval completely follows this.
 boolean before(TimeInterval other)
          Verifies if another time interval completely precedes this.
 Duration getDuration()
          Returns the duration of this time interval.
 Day getHighDay()
           
 Day getLowDay()
           
 PhysicalDuration getPhysicalDuration()
           
 boolean includes(Date d)
          Verifies that a time point is in this interval
 
Methods inherited from interface it.amattioli.encapsulate.range.Range
abutOn, contains, gap, getHigh, getLow, hasSameHigh, hasSameLow, intersect, isHighBounded, isLowBounded, mergeWith, minus, overlaps
 

Method Detail

getDuration

Duration getDuration()
Returns the duration of this time interval. This make sense only for a time interval that has both extremes, otherwise the duration is infinite.

Returns:
this time interval duration
Throws:
UnboundedRangeException - if this interval is not bounded

getPhysicalDuration

PhysicalDuration getPhysicalDuration()

includes

boolean includes(Date d)
Verifies that a time point is in this interval

Specified by:
includes in interface Range<Date>
Parameters:
d - the time point to be checked
Returns:
true if the parameter is inside this interval, false otherwise

before

boolean before(TimeInterval other)
Verifies if another time interval completely precedes this.

Parameters:
other - the time interval to be checked
Returns:
true if the passed time interval precedes this, otherwise false
Throws:
NullPointerException - if the parameter is null

after

boolean after(TimeInterval other)
Verifies if another time interval completely follows this.

Parameters:
other - the time interval to be checked
Returns:
true if the passed time interval follows this, otherwise flase
Throws:
NullPointerException - if the parameter is null

getLowDay

Day getLowDay()

getHighDay

Day getHighDay()


Copyright © 2011. All Rights Reserved.