Class PeriodGroup

java.lang.Object
COM.TIBCO.hawk.config.rbengine.schedule.PeriodGroup
All Implemented Interfaces:
Scheduleable, Cloneable

public class PeriodGroup extends Object implements Scheduleable, Cloneable
A PeriodGroup is a logical group of Periods useful for defining an asbtract group of Periods. For example, a PeriodGroup named Holiday may contain periods that include all the holidays within a year. To use a PeriodGroup in the inclusion or exclusion periods of a Schedule, the PeriodGroup is referenced by a PeriodGroupReference added to inclusion or exclusion periods of a schedule.

A PeriodGroup is in-schedule only if all of its periods are in-schedule. Otherwise, a PeriodGroup is out-of-schedule.

See Also:
  • Constructor Details

    • PeriodGroup

      public PeriodGroup(String name)
      Creates an empty PeriodGroup with the specified name.
    • PeriodGroup

      public PeriodGroup(String name, Period[] periods) throws ScheduleException
      Creates a PeriodGroup with specified name and periods.
      Throws:
      ScheduleException - if invalid periods are specified.
  • Method Details

    • setName

      public void setName(String name)
      Sets the name this PeriodGroup.
    • getName

      public String getName()
      Returns the name of this PeriodGroup.
    • setPeriods

      public void setPeriods(Period[] periods) throws ScheduleException
      Replaces the periods in this PeriodGroup with the specified periods.

      Parameters:
      periods - an array of Periods .
      Throws:
      ScheduleException - if invalid periods are specified.
    • getPeriods

      public Period[] getPeriods()
      Returns the periods in this PeriodGroup.

      Returns:
      the periods in this PeriodGroup.
    • equals

      public boolean equals(Object o)
      Compares the specified object with this PeriodGroup.

      Overrides:
      equals in class Object
      Parameters:
      o - Object to compare.
      Returns:
      true if objects are equal, false otherwise.
    • clone

      public Object clone() throws CloneNotSupportedException
      Returns a copy of this PeriodGroup.
      Overrides:
      clone in class Object
      Returns:
      a copy of this PeriodGroup.
      Throws:
      CloneNotSupportedException
    • toString

      public String toString(int iType)
      Returns a string reprensentation of this PeriodGroup.
    • inSchedule

      public boolean inSchedule(GregorianCalendar gc)
      Checks to see if this PeriodGroup is in schedule based on the specified GregorianCalendar.
      Specified by:
      inSchedule in interface Scheduleable
      Parameters:
      gc - GregorianCalendar for checking if this PeriodGroup is in schedule.
      Returns:
      true Period is in schedule.