public class CalendarScale extends EnumProperty
Defines the calendar system that this iCalendar object uses for all its date values. If none is specified, then the calendar is assumed to be in "gregorian" format.
Code sample (creating):
ICalendar ical = new ICalendar();
ical.setCalendarScale(CalendarScale.gregorian());
ical = new ICalendar();
ical.setCalendarScale(new CalendarScale("another-calendar-system"));
Code sample (retrieving):
ICalendar ical = ...
CalendarScale calscale = ical.getCalendarscale();
if (calscale.isGregorian()) {
//...
} else {
String value = calscale.getValue();
//...
}
| Modifier and Type | Field and Description |
|---|---|
static String |
GREGORIAN |
valueparameters| Constructor and Description |
|---|
CalendarScale(CalendarScale original)
Copy constructor.
|
CalendarScale(String value)
Creates a new calendar scale property.
|
| Modifier and Type | Method and Description |
|---|---|
CalendarScale |
copy()
Creates a copy of this property object.
|
protected Collection<String> |
getStandardValues(ICalVersion version)
Gets the list of acceptable values for this property.
|
protected Collection<ICalVersion> |
getValueSupportedVersions()
Gets the iCalendar versions that this property's value is supported in.
|
static CalendarScale |
gregorian()
Creates a new property whose value is set to "gregorian".
|
boolean |
isGregorian()
Determines whether the property is set to "gregorian".
|
equals, hashCode, is, validategetValue, getValue, setValue, toStringValues, valueEquals, valueHashCodeaddParameter, getParameter, getParameters, getParameters, removeParameter, setParameter, setParameter, setParameters, toString, validatepublic static final String GREGORIAN
public CalendarScale(String value)
value - the value of the property (e.g. "gregorian")public CalendarScale(CalendarScale original)
original - the property to make a copy ofpublic static CalendarScale gregorian()
public boolean isGregorian()
protected Collection<String> getStandardValues(ICalVersion version)
EnumPropertygetStandardValues in class EnumPropertyversion - the versionprotected Collection<ICalVersion> getValueSupportedVersions()
EnumPropertygetValueSupportedVersions in class EnumPropertypublic CalendarScale copy()
ICalPropertyCreates a copy of this property object.
The default implementation of this method uses reflection to look for a copy constructor. Child classes SHOULD override this method to avoid the performance overhead involved in using reflection.
The child class's copy constructor, if present, MUST invoke the
ICalProperty.ICalProperty(ICalProperty) super constructor to ensure that the
parameters are also copied.
This method MUST be overridden by the child class if the child class does
not have a copy constructor. Otherwise, an
UnsupportedOperationException will be thrown when an attempt is
made to copy the property (such as in the
ICalendar class's copy constructor
).
copy in class ICalPropertyCopyright © 2013-2017 Michael Angstadt. All Rights Reserved.