org.ofbiz.service.calendar
Class TemporalExpressions.Difference

java.lang.Object
  extended by org.ofbiz.service.calendar.TemporalExpression
      extended by org.ofbiz.service.calendar.TemporalExpressions.Difference
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<TemporalExpression>
Enclosing class:
TemporalExpressions

public static class TemporalExpressions.Difference
extends TemporalExpression

This class represents a difference of two temporal expressions.

See Also:
Serialized Form

Field Summary
protected  TemporalExpression excluded
           
protected  TemporalExpression included
           
 
Fields inherited from class org.ofbiz.service.calendar.TemporalExpression
id, sequence, subSequence
 
Constructor Summary
TemporalExpressions.Difference(TemporalExpression included, TemporalExpression excluded)
           
 
Method Summary
 void accept(TemporalExpressionVisitor visitor)
          Handles a TemporalExpressionVisitor visit.
protected  boolean containsExpression(TemporalExpression expression)
           
 boolean equals(java.lang.Object obj)
           
 java.util.Calendar first(java.util.Calendar cal)
          Returns a date representing the first occurrence of this expression on or after a specified date.
 TemporalExpression getExcluded()
          Returns the excluded expression.
 TemporalExpression getIncluded()
          Returns the included expression.
 java.util.Set<java.util.Date> getRange(DateRange range, java.util.Calendar cal)
          Returns a range of dates matching this expression.
 boolean includesDate(java.util.Calendar cal)
          Returns true if this expression includes the specified date.
 java.util.Calendar next(java.util.Calendar cal)
          Returns a date representing the next occurrence of this expression after a specified date.
 java.lang.String toString()
           
 
Methods inherited from class org.ofbiz.service.calendar.TemporalExpression
compareTo, getId, setId, setStartOfDay
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

included

protected final TemporalExpression included

excluded

protected final TemporalExpression excluded
Constructor Detail

TemporalExpressions.Difference

public TemporalExpressions.Difference(TemporalExpression included,
                                      TemporalExpression excluded)
Method Detail

equals

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

toString

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

includesDate

public boolean includesDate(java.util.Calendar cal)
Description copied from class: TemporalExpression
Returns true if this expression includes the specified date.

Specified by:
includesDate in class TemporalExpression
Parameters:
cal - A date to evaluate
Returns:
true if this expression includes the date represented by cal

first

public java.util.Calendar first(java.util.Calendar cal)
Description copied from class: TemporalExpression
Returns a date representing the first occurrence of this expression on or after a specified date. Returns null if there is no matching date.

Specified by:
first in class TemporalExpression
Parameters:
cal - A date to evaluate
Returns:
A Calendar instance representing the first matching date, or null if no matching date is found

next

public java.util.Calendar next(java.util.Calendar cal)
Description copied from class: TemporalExpression
Returns a date representing the next occurrence of this expression after a specified date. Returns null if there is no matching date.

Specified by:
next in class TemporalExpression
Parameters:
cal - A date to evaluate
Returns:
A Calendar instance representing the first matching date, or null if no matching date is found

accept

public void accept(TemporalExpressionVisitor visitor)
Description copied from class: TemporalExpression
Handles a TemporalExpressionVisitor visit.

Specified by:
accept in class TemporalExpression

getRange

public java.util.Set<java.util.Date> getRange(DateRange range,
                                              java.util.Calendar cal)
Description copied from class: TemporalExpression
Returns a range of dates matching this expression. Returns an empty Set if no dates are found.

Overrides:
getRange in class TemporalExpression
Parameters:
range - The range of dates to evaluate
cal - The starting date
Returns:
A Set of matching Date objects

getExcluded

public TemporalExpression getExcluded()
Returns the excluded expression.

Returns:
The excluded TemporalExpression

getIncluded

public TemporalExpression getIncluded()
Returns the included expression.

Returns:
The included TemporalExpression

containsExpression

protected boolean containsExpression(TemporalExpression expression)
Overrides:
containsExpression in class TemporalExpression