Overview | Package | Class | Tree | Deprecated | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.treesched.schedules
Class TimeSchedule

    java.lang.Object
      org.treesched.AbstractSchedule
          org.treesched.ConstrainedSchedule
              org.treesched.schedules.TimeSchedule

All Implemented Interfaces:
  RefineableSchedule, Schedule, java.io.Serializable

public final class TimeSchedule
extends ConstrainedSchedule
implements java.io.Serializable

A shcedule that returns an interval which is between times of the day, or between times of the day at given intervals.

Typical configuration is: ``

     <time from="10:00" to="14:00"/>

Author:
  Rob Gordon
See Also:
  Serialized Form

Field Summary
`static java.lang.String` | `DEFAULT_DATE_FORMAT`

Constructor Summary
`TimeSchedule()` Constructor.

Method Summary
`java.util.Calendar` | `calendarFor(java.util.Date date, long time)` Get the milliseconds in since the start of the given day as a calendar.
`java.util.Date` | `getEndDate(java.util.Date now)` For the given time, calculate when this schedule interval should finish.
`java.lang.String` | `getFormat()` Get the date format used for translating string attributes.
`java.lang.String` | `getFrom()` Get the from date/time as a String.
`java.util.Date` | `getStartDate(java.util.Date now)` For the given time, calculate when this schedule should start or should have started.
`java.lang.String` | `getTo()` Get the to date/time as a String.
`void` | `setFormat(java.lang.String dateFormat)` Set the date format to use for translating string attributes.
`void` | `setFrom(java.lang.String from)` Set the from date/time as a String.
`void` | `setTo(java.lang.String to)` Set the to date/time as a String.

Methods inherited from class org.treesched.ConstrainedSchedule
`nextDue, setOn, toString`

Methods inherited from class org.treesched.AbstractSchedule
`addChildSchedule, getChildSchedule, getLimits, reset, setChildSchedule, setLimits`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### DEFAULT_DATE_FORMAT

    public static final java.lang.String DEFAULT_DATE_FORMAT

See Also:
  Constant Field Values

Constructor Detail

### TimeSchedule

    public TimeSchedule()

  Constructor.

Method Detail

### setFormat

    public void setFormat(java.lang.String dateFormat)

  Set the date format to use for translating string attributes.

  Parameters:
    `dateFormat` - The date format.

### getFormat

    public java.lang.String getFormat()

  Get the date format used for translating string attributes.

  Returns:
    The date format being used.

### setFrom

    public void setFrom(java.lang.String from)
                 throws java.text.ParseException

  Description copied from class: `ConstrainedSchedule`
  Set the from date/time as a String.

  Specified by:
    `setFrom` in class `ConstrainedSchedule`
  Parameters:
    `from` - The from date.
  Throws:
    `java.text.ParseException` - If the String can not be parsed to a date.

### getFrom

    public java.lang.String getFrom()

  Description copied from class: `ConstrainedSchedule`
  Get the from date/time as a String.

  Specified by:
    `getFrom` in class `ConstrainedSchedule`
  Returns:
    The from date.

### setTo

    public void setTo(java.lang.String to)
               throws java.text.ParseException

  Description copied from class: `ConstrainedSchedule`
  Set the to date/time as a String.

  Specified by:
    `setTo` in class `ConstrainedSchedule`
  Parameters:
    `to` - The to date.
  Throws:
    `java.text.ParseException` - If the String can not be parsed to a date.

### getTo

    public java.lang.String getTo()

  Description copied from class: `ConstrainedSchedule`
  Get the to date/time as a String.

  Specified by:
    `getTo` in class `ConstrainedSchedule`
  Returns:
    The to date.

### calendarFor

    public java.util.Calendar calendarFor(java.util.Date date,
                                          long time)

  Get the milliseconds in since the start of the given day as a calendar.

  Parameters:
    `date` - The date to take the day from.
    `time` - The time in milliseoncs since the start of day.
  Returns:
    A Calander.

### getStartDate

    public java.util.Date getStartDate(java.util.Date now)

  Description copied from class: `ConstrainedSchedule`
  For the given time, calculate when this schedule should start or should have started.

  Specified by:
    `getStartDate` in class `ConstrainedSchedule`
  Parameters:
    `now` - The date/time now.
  Returns:
    The date/time the scheudle is/was due.

### getEndDate

    public java.util.Date getEndDate(java.util.Date now)

  Description copied from class: `ConstrainedSchedule`
  For the given time, calculate when this schedule interval should finish.

  Specified by:
    `getEndDate` in class `ConstrainedSchedule`
  Parameters:
    `now` - The date/time now.
  Returns:
    The date/time the schedule should finish.

Overview | Package | Class | Tree | Deprecated | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD