This is a representation of a generic ICalendar component.
Field Summary |
protected Map |
properties
contains a map from property name -> List of Property objects |
protected List |
subComponents
contains a map of Component objects |
Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait |
properties
protected Map properties
- contains a map from property name -> List of Property objects
subComponents
protected List subComponents
- contains a map of Component objects
Component
public Component()
getName
public abstract String getName()
- Return the name of this Component.
getProperty
public List getProperty(String name)
- Return a List containing Property representing all of the properties
associated with this component
- Returns:
- a List<Property>
getPropertyMap
public Map getPropertyMap()
getSingleString
public UnknownSingleString getSingleString(String name)
getSingleInteger
public UnknownSingleInteger getSingleInteger(String name)
getSingleDate
public UnknownSingleDate getSingleDate(String name)
getSingleDuration
public UnknownSingleDuration getSingleDuration(String name)
getComponents
public List getComponents()
- Return a List containing Component representing all
subcomponents of this Component.
- Returns:
- a List<Component>
getInstance
public static Component getInstance(String name,
Map properties,
List subComponents)
throws BadComponentException
- Create a Property object of the correct type for
name
.
- Parameters:
name
- the name of the componentproperties
- a map of property name to a List of propertiessubComponents
- a list of subcomponents of this component- Returns:
- an instance of a subclass of Component
- Throws:
BadComponentException
- when an invariant of this
Component is violated
outputICalendar
public Writer outputICalendar(Writer w)
throws IOException
- Write the iCalendar representation to w. It invokes the
output
method of each subcomponent and each
property of this object.
- Parameters:
w
- the writer to send output to- Returns:
- the writer
w
- Throws:
IOException
- when w
does so
toString
public String toString()
- Returns this Component in iCalendar form. This just invokes the
output
method, and using that method should be
preferred.
- Overrides:
toString
in class Object
- Returns:
- a string representation of this object