Class TemporalExpression

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.lang.String id
      A unique ID for this expression.
      protected int sequence
      Field used to sort expressions.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected TemporalExpression()  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      abstract void accept​(TemporalExpressionVisitor visitor)
      Handles a TemporalExpressionVisitor visit.
      int compareTo​(TemporalExpression obj)  
      protected boolean containsExpression​(TemporalExpression expression)  
      boolean equals​(java.lang.Object obj)  
      abstract 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.
      java.lang.String getId()
      Returns this expression's ID.
      java.util.Set<java.util.Date> getRange​(DateRange range, com.ibm.icu.util.Calendar cal)
      Returns a range of dates matching this expression.
      int hashCode()  
      abstract boolean includesDate​(com.ibm.icu.util.Calendar cal)
      Returns true if this expression includes the specified date.
      abstract 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)
      Returns a date representing the next occurrence of this expression after a specified date.
      protected abstract com.ibm.icu.util.Calendar next​(com.ibm.icu.util.Calendar cal, TemporalExpression.ExpressionContext context)  
      void setId​(java.lang.String id)
      Sets this expression's ID.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • sequence

        protected int sequence
        Field used to sort expressions. Expression evaluation depends on correct ordering. Expressions are evaluated from lowest value to highest value.
      • id

        protected java.lang.String id
        A unique ID for this expression. This field is intended to be used by persistence classes.
    • Constructor Detail

      • TemporalExpression

        protected TemporalExpression()
    • Method Detail

      • accept

        public abstract void accept​(TemporalExpressionVisitor visitor)
        Handles a TemporalExpressionVisitor visit.
        Parameters:
        visitor -
      • equals

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

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • containsExpression

        protected boolean containsExpression​(TemporalExpression expression)
      • first

        public abstract 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. Returns null if there is no matching date.
        Parameters:
        cal - A date to evaluate
        Returns:
        A Calendar instance representing the first matching date, or null if no matching date is found
      • getId

        public java.lang.String getId()
        Returns this expression's ID.
        Returns:
        Expression ID String
      • getRange

        public java.util.Set<java.util.Date> getRange​(DateRange range,
                                                      com.ibm.icu.util.Calendar cal)
        Returns a range of dates matching this expression. Returns an empty Set if no dates are found.
        Parameters:
        range - The range of dates to evaluate
        cal - The starting date
        Returns:
        A Set of matching Date objects
      • includesDate

        public abstract boolean includesDate​(com.ibm.icu.util.Calendar cal)
        Returns true if this expression includes the specified date.
        Parameters:
        cal - A date to evaluate
        Returns:
        true if this expression includes the date represented by cal
      • isSubstitutionCandidate

        public abstract 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. 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.
        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)
        Returns a date representing the next occurrence of this expression after a specified date. Returns null if there is no matching date.
        Parameters:
        cal - A date to evaluate
        Returns:
        A Calendar instance representing the first matching date, or null if no matching date is found
      • setId

        public void setId​(java.lang.String id)
        Sets this expression's ID.
        Parameters:
        id - Expression ID String
      • toString

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