Module ical4j.core

Class Observance

All Implemented Interfaces:
Serializable, Comparable<Component>, FluentComponent, PropertyContainer, PropertyListAccessor, Prototype<Component>, TimeZonePropertyAccessor
Direct Known Subclasses:
Daylight, Standard

public abstract class Observance extends Component implements TimeZonePropertyAccessor
$Id$ [05-Apr-2004]

Defines an iCalendar sub-component representing a timezone observance. Class made abstract such that only Standard and Daylight instances are valid.

See Also:
  • Field Details

    • STANDARD

      public static final String STANDARD
      one of 'standardc' or 'daylightc' MUST occur and each MAY occur more than once.
      See Also:
    • DAYLIGHT

      public static final String DAYLIGHT
      Token for daylight observance.
      See Also:
  • Constructor Details

    • Observance

      protected Observance(String name)
      Constructs a timezone observance with the specified name and no properties.
      Parameters:
      name - the name of this observance component
    • Observance

      protected Observance(String name, PropertyList properties)
      Constructor protected to enforce use of sub-classes from this library.
      Parameters:
      name - the name of the time type
      properties - a list of properties
  • Method Details

    • validate

      public ValidationResult validate(boolean recurse) throws ValidationException
      Perform validation on a component.
      Specified by:
      validate in class Component
      Parameters:
      recurse - indicates whether to validate the component's properties
      Throws:
      ValidationException - where the component is not in a valid state
    • getLatestOnset

      public final OffsetDateTime getLatestOnset(Temporal date)
      Returns the latest applicable onset of this observance for the specified date.
      Parameters:
      date - the latest date that an observance onset may occur
      Returns:
      the latest applicable observance date or null if there is no applicable observance onset for the specified date