biweekly.util
Class Recurrence

java.lang.Object
  extended by biweekly.util.Recurrence

public final class Recurrence
extends Object

Represents a recurrence rule value.

This class is immutable. Use the Recurrence.Builder object to construct a new instance.

Examples:

 //"bi-weekly"
 Recurrence rrule = new Recurrence.Builder(Frequency.WEEKLY).interval(2).build();
 Recurrence copy = new Recurrence.Builder(rrule).interval(3).build();
 

Author:
Michael Angstadt
Specification Reference:
RFC 5545 p.38-45

Nested Class Summary
static class Recurrence.Builder
          Constructs Recurrence objects.
static class Recurrence.DayOfWeek
          Represents each of the seven days of the week.
static class Recurrence.Frequency
          Represents the frequency at which a recurrence rule repeats itself.
 
Method Summary
 boolean equals(Object obj)
           
 List<Recurrence.DayOfWeek> getByDay()
          Gets the day components of the BYDAY rule part.
 List<Integer> getByDayPrefixes()
          Gets the numeric components of the BYDAY rule part.
 List<Integer> getByHour()
          Gets the BYHOUR rule part.
 List<Integer> getByMinute()
          Gets the BYMINUTE rule part.
 List<Integer> getByMonth()
          Gets the BYMONTH rule part.
 List<Integer> getByMonthDay()
          Gets the BYMONTHDAY rule part.
 List<Integer> getBySecond()
          Gets the BYSECOND rule part.
 List<Integer> getBySetPos()
          Gets the BYSETPOS rule part.
 List<Integer> getByWeekNo()
          Gets the BYWEEKNO rule part.
 List<Integer> getByYearDay()
          Gets the BYYEARDAY rule part.
 Integer getCount()
          Gets the number of times the rule will be repeated.
 Recurrence.Frequency getFrequency()
          Gets the frequency.
 Integer getInterval()
          Gets how often the rule repeats, in relation to the frequency.
 Date getUntil()
          Gets the date that the recurrence stops.
 Recurrence.DayOfWeek getWorkweekStarts()
          Gets the day that the work week starts.
 Map<String,List<String>> getXRules()
          Gets the non-standard rule parts.
 int hashCode()
           
 boolean hasTimeUntilDate()
          Determines whether the UNTIL date has a time component.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getFrequency

public Recurrence.Frequency getFrequency()
Gets the frequency.

Returns:
the frequency or null if not set

getUntil

public Date getUntil()
Gets the date that the recurrence stops.

Returns:
the date or null if not set

hasTimeUntilDate

public boolean hasTimeUntilDate()
Determines whether the UNTIL date has a time component.

Returns:
true if it has a time component, false if it is strictly a date

getCount

public Integer getCount()
Gets the number of times the rule will be repeated.

Returns:
the number of times to repeat the rule or null if not set

getInterval

public Integer getInterval()
Gets how often the rule repeats, in relation to the frequency.

Returns:
the repetition interval or null if not set

getBySecond

public List<Integer> getBySecond()
Gets the BYSECOND rule part.

Returns:
the BYSECOND rule part or empty list if not set

getByMinute

public List<Integer> getByMinute()
Gets the BYMINUTE rule part.

Returns:
the BYMINUTE rule part or empty list if not set

getByHour

public List<Integer> getByHour()
Gets the BYHOUR rule part.

Returns:
the BYHOUR rule part or empty list if not set

getByDay

public List<Recurrence.DayOfWeek> getByDay()
Gets the day components of the BYDAY rule part.

Returns:
the day components of the BYDAY rule part or empty list if not set

getByDayPrefixes

public List<Integer> getByDayPrefixes()
Gets the numeric components of the BYDAY rule part.

Returns:
the numeric components of the BYDAY rule part or empty list if not set (BYDAY values without numeric components will have a "null" number)

getByMonthDay

public List<Integer> getByMonthDay()
Gets the BYMONTHDAY rule part.

Returns:
the BYMONTHDAY rule part or empty list if not set

getByYearDay

public List<Integer> getByYearDay()
Gets the BYYEARDAY rule part.

Returns:
the BYYEARDAY rule part or empty list if not set

getByWeekNo

public List<Integer> getByWeekNo()
Gets the BYWEEKNO rule part.

Returns:
the BYWEEKNO rule part or empty list if not set

getByMonth

public List<Integer> getByMonth()
Gets the BYMONTH rule part.

Returns:
the BYMONTH rule part or empty list if not set

getBySetPos

public List<Integer> getBySetPos()
Gets the BYSETPOS rule part.

Returns:
the BYSETPOS rule part or empty list if not set

getWorkweekStarts

public Recurrence.DayOfWeek getWorkweekStarts()
Gets the day that the work week starts.

Returns:
the day that the work week starts or null if not set

getXRules

public Map<String,List<String>> getXRules()
Gets the non-standard rule parts.

Returns:
the non-standard rule parts

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object


Copyright © 2013 Michael Angstadt. All Rights Reserved.