org.ofbiz.service.calendar
Class TemporalExpressions.DayInMonth

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

public static class TemporalExpressions.DayInMonth
extends TemporalExpression

A temporal expression that represents a day in the month.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.ofbiz.service.calendar.TemporalExpression
TemporalExpression.ExpressionContext
 
Field Summary
protected  int dayOfWeek
           
protected  int occurrence
           
 
Fields inherited from class org.ofbiz.service.calendar.TemporalExpression
id, sequence
 
Constructor Summary
TemporalExpressions.DayInMonth(int dayOfWeek, int occurrence)
           
 
Method Summary
 void accept(TemporalExpressionVisitor visitor)
          Handles a TemporalExpressionVisitor visit.
protected  com.ibm.icu.util.Calendar alignDayOfWeek(com.ibm.icu.util.Calendar cal)
           
 boolean equals(java.lang.Object obj)
           
 com.ibm.icu.util.Calendar first(com.ibm.icu.util.Calendar cal)
          Returns a date representing the first occurrence of this expression on or after a specified date.
 int getDayOfWeek()
          Returns the day of week in this expression.
 int getOccurrence()
          Returns the occurrence in this expression.
 boolean includesDate(com.ibm.icu.util.Calendar cal)
          Returns true if this expression includes the specified date.
 boolean isSubstitutionCandidate(com.ibm.icu.util.Calendar cal, TemporalExpression expressionToTest)
          Returns true if this expression is a candidate for substitution using the expression expressionToTest for the date cal.
 com.ibm.icu.util.Calendar next(com.ibm.icu.util.Calendar cal, TemporalExpression.ExpressionContext context)
           
 java.lang.String toString()
           
 
Methods inherited from class org.ofbiz.service.calendar.TemporalExpression
compareTo, containsExpression, getId, getRange, next, setId
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

dayOfWeek

protected final int dayOfWeek

occurrence

protected final int occurrence
Constructor Detail

TemporalExpressions.DayInMonth

public TemporalExpressions.DayInMonth(int dayOfWeek,
                                      int occurrence)
Parameters:
dayOfWeek - An integer in the range of Calendar.SUNDAY to Calendar.SATURDAY
occurrence - An integer in the range of -5 to 5, excluding zero
Method Detail

accept

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

Specified by:
accept in class TemporalExpression

alignDayOfWeek

protected com.ibm.icu.util.Calendar alignDayOfWeek(com.ibm.icu.util.Calendar cal)

equals

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

first

public com.ibm.icu.util.Calendar first(com.ibm.icu.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

getDayOfWeek

public int getDayOfWeek()
Returns the day of week in this expression.

Returns:
The day of week in this expression

getOccurrence

public int getOccurrence()
Returns the occurrence in this expression.

Returns:
The occurrence in this expression

includesDate

public boolean includesDate(com.ibm.icu.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

isSubstitutionCandidate

public boolean isSubstitutionCandidate(com.ibm.icu.util.Calendar cal,
                                       TemporalExpression expressionToTest)
Description copied from class: TemporalExpression
Returns true if this expression is a candidate for substitution using the expression expressionToTest for the date cal. A Substitution object will call this method when it needs to know if this expression could have produced the date cal based on the expression expressionToTest.

Specified by:
isSubstitutionCandidate in class TemporalExpression
Parameters:
cal - A date to evaluate
expressionToTest - An expression to evaluate
Returns:
true if this expression could have produced the date cal using the expression expressionToTest

next

public com.ibm.icu.util.Calendar next(com.ibm.icu.util.Calendar cal,
                                      TemporalExpression.ExpressionContext context)
Specified by:
next in class TemporalExpression

toString

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