Class TemporalExpressions.Substitution
- java.lang.Object
-
- org.apache.ofbiz.service.calendar.TemporalExpression
-
- org.apache.ofbiz.service.calendar.TemporalExpressions.Substitution
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<TemporalExpression>
- Enclosing class:
- TemporalExpressions
public static class TemporalExpressions.Substitution extends TemporalExpression
A temporal expression that provides a substitution for an excluded temporal expression.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.ofbiz.service.calendar.TemporalExpression
TemporalExpression.ExpressionContext
-
-
Field Summary
Fields Modifier and Type Field Description protected TemporalExpression
excluded
protected TemporalExpression
included
static java.lang.String
module
protected TemporalExpression
substitute
-
Fields inherited from class org.apache.ofbiz.service.calendar.TemporalExpression
id, sequence
-
-
Constructor Summary
Constructors Constructor Description Substitution(TemporalExpression included, TemporalExpression excluded, TemporalExpression substitute)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
accept(TemporalExpressionVisitor visitor)
Handles aTemporalExpressionVisitor
visit.protected boolean
containsExpression(TemporalExpression expression)
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.TemporalExpression
getExcluded()
Returns the excluded expression.TemporalExpression
getIncluded()
Returns the included expression.TemporalExpression
getSubstitute()
Returns the substitute expression.int
hashCode()
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 expressionexpressionToTest
for the datecal
.com.ibm.icu.util.Calendar
next(com.ibm.icu.util.Calendar cal, TemporalExpression.ExpressionContext context)
java.lang.String
toString()
-
-
-
Field Detail
-
module
public static final java.lang.String module
-
excluded
protected final TemporalExpression excluded
-
included
protected final TemporalExpression included
-
substitute
protected final TemporalExpression substitute
-
-
Constructor Detail
-
Substitution
public Substitution(TemporalExpression included, TemporalExpression excluded, TemporalExpression substitute)
-
-
Method Detail
-
accept
public void accept(TemporalExpressionVisitor visitor)
Description copied from class:TemporalExpression
Handles aTemporalExpressionVisitor
visit.- Specified by:
accept
in classTemporalExpression
-
containsExpression
protected boolean containsExpression(TemporalExpression expression)
- Overrides:
containsExpression
in classTemporalExpression
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classTemporalExpression
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classTemporalExpression
-
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. Returnsnull
if there is no matching date.- Specified by:
first
in classTemporalExpression
- Parameters:
cal
- A date to evaluate- Returns:
- A Calendar instance representing the first matching date,
or
null
if no matching date is found
-
getExcluded
public TemporalExpression getExcluded()
Returns the excluded expression.- Returns:
- The excluded
TemporalExpression
-
getIncluded
public TemporalExpression getIncluded()
Returns the included expression.- Returns:
- The included
TemporalExpression
-
getSubstitute
public TemporalExpression getSubstitute()
Returns the substitute expression.- Returns:
- The substitute
TemporalExpression
-
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 classTemporalExpression
- 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 expressionexpressionToTest
for the datecal
. ASubstitution
object will call this method when it needs to know if this expression could have produced the datecal
based on the expressionexpressionToTest
.- Specified by:
isSubstitutionCandidate
in classTemporalExpression
- Parameters:
cal
- A date to evaluateexpressionToTest
- An expression to evaluate- Returns:
- true if this expression could have produced the date
cal
using the expressionexpressionToTest
-
next
public com.ibm.icu.util.Calendar next(com.ibm.icu.util.Calendar cal, TemporalExpression.ExpressionContext context)
- Specified by:
next
in classTemporalExpression
-
toString
public java.lang.String toString()
- Overrides:
toString
in classTemporalExpression
-
-