|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.fortuna.ical4j.model.Calendar
public class Calendar
Defines an iCalendar calendar.
4.6 Calendar Components The body of the iCalendar object consists of a sequence of calendar properties and one or more calendar components. The calendar properties are attributes that apply to the calendar as a whole. The calendar components are collections of properties that express a particular calendar semantic. For example, the calendar component can specify an event, a to-do, a journal entry, time zone information, or free/busy time information, or an alarm. The body of the iCalendar object is defined by the following notation: icalbody = calprops component calprops = 2*( ; 'prodid' and 'version' are both REQUIRED, ; but MUST NOT occur more than once prodid /version / ; 'calscale' and 'method' are optional, ; but MUST NOT occur more than once calscale / method / x-prop ) component = 1*(eventc / todoc / journalc / freebusyc / / timezonec / iana-comp / x-comp) iana-comp = "BEGIN" ":" iana-token CRLF 1*contentline "END" ":" iana-token CRLF x-comp = "BEGIN" ":" x-name CRLF 1*contentline "END" ":" x-name CRLFExample 1 - Creating a new calendar:
Calendar calendar = new Calendar();
calendar.getProperties().add(new ProdId("-//Ben Fortuna//iCal4j 1.0//EN"));
calendar.getProperties().add(Version.VERSION_2_0);
calendar.getProperties().add(CalScale.GREGORIAN);
// Add events, etc..
Field Summary | |
---|---|
static java.lang.String |
BEGIN
|
static java.lang.String |
END
|
static java.lang.String |
VCALENDAR
|
Constructor Summary | |
---|---|
Calendar()
Default constructor. |
|
Calendar(Calendar c)
Creates a deep copy of the specified calendar. |
|
Calendar(ComponentList components)
Constructs a new calendar with no properties and the specified components. |
|
Calendar(PropertyList p,
ComponentList c)
Constructor. |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object arg0)
Uses ObjectUtils to test equality. |
CalScale |
getCalendarScale()
Returns the optional calscale property. |
Component |
getComponent(java.lang.String name)
Convenience method for retrieving a named component. |
ComponentList |
getComponents()
|
ComponentList |
getComponents(java.lang.String name)
Convenience method for retrieving a list of named components. |
Method |
getMethod()
Returns the optional method property. |
ProdId |
getProductId()
Returns the mandatory prodid property. |
PropertyList |
getProperties()
|
PropertyList |
getProperties(java.lang.String name)
Convenience method for retrieving a list of named properties. |
Property |
getProperty(java.lang.String name)
Convenience method for retrieving a named property. |
Version |
getVersion()
Returns the mandatory version property. |
int |
hashCode()
Uses HashCodeBuilder to build hashcode. |
java.lang.String |
toString()
|
void |
validate()
Perform validation on the calendar, its properties and its components in its current state. |
void |
validate(boolean recurse)
Perform validation on the calendar in its current state. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String BEGIN
public static final java.lang.String VCALENDAR
public static final java.lang.String END
Constructor Detail |
---|
public Calendar()
public Calendar(ComponentList components)
components
- a list of components to add to the calendarpublic Calendar(PropertyList p, ComponentList c)
p
- a list of propertiesc
- a list of componentspublic Calendar(Calendar c) throws java.text.ParseException, java.io.IOException, java.net.URISyntaxException
c
- the calendar to copy
java.text.ParseException
java.io.IOException
java.net.URISyntaxException
Method Detail |
---|
public final java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
public final ComponentList getComponents()
public final ComponentList getComponents(java.lang.String name)
name
- name of components to retrieve
public final Component getComponent(java.lang.String name)
name
- name of the component to retrieve
public final PropertyList getProperties()
public final PropertyList getProperties(java.lang.String name)
name
- name of properties to retrieve
public final Property getProperty(java.lang.String name)
name
- name of the property to retrieve
public final void validate() throws ValidationException
ValidationException
- where the calendar is not in a valid statepublic void validate(boolean recurse) throws ValidationException
recurse
- indicates whether to validate the calendar's properties and components
ValidationException
- where the calendar is not in a valid statepublic final ProdId getProductId()
public final Version getVersion()
public final CalScale getCalendarScale()
public final Method getMethod()
public final boolean equals(java.lang.Object arg0)
ObjectUtils
to test equality. Two calendars are equal if and only if their property lists and
component lists are equal.
equals
in class java.lang.Object
public final int hashCode()
HashCodeBuilder
to build hashcode.
hashCode
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |