Class ParsedDuring

java.lang.Object
org.kigalisim.lang.time.ParsedDuring

public class ParsedDuring extends Object
Description of a "during" time period described in QubecTalk.
Description of a "during" time period described in QubecTalk where the following are observed:
  • Single year ranges should have both start and end with the same TimePoints.
  • A range which should apply starting in a year until the end may have start be non-empty and the end is empty. Alternatively, start may be given and empty be onwards (dynamic cap).
  • A range which should apply until a given year may have start be non-empty an the start is empty. Alternatively, end may be given and start be beginning (dynamic cap).
  • Other ranges may have start and end both specified.
  • Constructor Details

    • ParsedDuring

      public ParsedDuring(Optional<TimePointFuture> start, Optional<TimePointFuture> end)
      Create a description of a "during" time period.
      Parameters:
      start - The start of the period, or empty if unbounded.
      end - The end of the period, or empty if unbounded.
  • Method Details

    • getStart

      public Optional<TimePointFuture> getStart()
      Get the start of the period.
      Returns:
      The start of the period, or empty if unbounded.
    • getEnd

      public Optional<TimePointFuture> getEnd()
      Get the end of the period.
      Returns:
      The end of the period, or empty if unbounded.
    • buildYearMatcher

      public YearMatcher buildYearMatcher(PushDownMachine machine)
      Build a YearMatcher from this parsed version of a during statement.

      If a TimePointFuture is a dynamic cap (beginning or onwards), it is interpreted as Optional.empty().

      Parameters:
      machine - Machine to use for calculations if needed.
      Returns:
      The YearMatcher built from the values parsed and saved to this ParsedDuring.