Class TemporalExpressions.HourRange

java.lang.Object
org.apache.ofbiz.service.calendar.TemporalExpression
org.apache.ofbiz.service.calendar.TemporalExpressions.HourRange
All Implemented Interfaces:
Serializable, Comparable<TemporalExpression>
Enclosing class:
TemporalExpressions

public static class TemporalExpressions.HourRange extends TemporalExpression
A temporal expression that represents an hour range.
See Also:
  • Constructor Details

    • HourRange

      public HourRange(int hour)
      Parameters:
      hour - An integer in the range of 0 to 23.
    • HourRange

      public HourRange(int start, int end)
      Parameters:
      start - An integer in the range of 0 to 23.
      end - An integer in the range of 0 to 23.
  • Method Details

    • accept

      public void accept(TemporalExpressionVisitor visitor)
      Description copied from class: TemporalExpression
      Handles a TemporalExpressionVisitor visit.
      Specified by:
      accept in class TemporalExpression
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class TemporalExpression
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class TemporalExpression
    • 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
    • getEndHour

      public int getEndHour()
      Returns the ending hour of this range.
      Returns:
      The ending hour of this range
    • getHourRangeAsSet

      public Set<Integer> getHourRangeAsSet()
      Gets hour range as set.
      Returns:
      the hour range as set
    • getStartHour

      public int getStartHour()
      Returns the starting hour of this range.
      Returns:
      The starting hour of this range
    • 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 String toString()
      Overrides:
      toString in class TemporalExpression