biweekly.property
Class FreeBusy

java.lang.Object
  extended by biweekly.property.ICalProperty
      extended by biweekly.property.FreeBusy

public class FreeBusy
extends ICalProperty

Defines a person's availability over certain time periods (for example, "busy" between 1pm-3pm and 4pm-5pm). Note that this property can contain multiple time periods, but only one availability type may be defined (e.g. "busy" or "free").

Examples:

 FreeBusy freebusy = new FreeBusy();
 freebusy.setType(FreeBusyType.BUSY);
 
 Date onePM = ...
 Date threePM = ...
 freebusy.addValue(onePM, threePM);
 
 Date fourPM = ...
 Duration oneHour = Duration.builder().hours(1).build();
 freeBusy.addValue(fourPM, oneHour);
 

Author:
Michael Angstadt
Specification Reference:
RFC 5545 p.100-1

Field Summary
 
Fields inherited from class biweekly.property.ICalProperty
parameters
 
Constructor Summary
FreeBusy()
           
 
Method Summary
 void addValue(Date start, Date end)
          Adds a time period.
 void addValue(Date start, Duration duration)
          Adds a time period.
 FreeBusyType getType()
          Gets the person's status over the time periods that are specified in this property (for example, "free" or "busy").
 List<Period> getValues()
          Gets all time periods.
 void setType(FreeBusyType fbType)
          Sets the person's status over the time periods that are specified in this property (for example, "free" or "busy").
protected  void validate(List<ICalComponent> components, List<String> warnings)
          Checks the property for data consistency problems or deviations from the spec.
 
Methods inherited from class biweekly.property.ICalProperty
addParameter, getParameter, getParameters, getParameters, removeParameter, setParameter, setParameter, setParameters, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FreeBusy

public FreeBusy()
Method Detail

addValue

public void addValue(Date start,
                     Date end)
Adds a time period.

Parameters:
start - the start date
end - the end date

addValue

public void addValue(Date start,
                     Duration duration)
Adds a time period.

Parameters:
start - the start date
duration - the duration

getValues

public List<Period> getValues()
Gets all time periods.

Returns:
the time periods

getType

public FreeBusyType getType()
Gets the person's status over the time periods that are specified in this property (for example, "free" or "busy"). If not set, the user should be considered "busy".

Returns:
the type or null if not set
Specification Reference:
RFC 5545 p.20

setType

public void setType(FreeBusyType fbType)
Sets the person's status over the time periods that are specified in this property (for example, "free" or "busy"). If not set, the user should be considered "busy".

Parameters:
fbType - the type or null to remove
Specification Reference:
RFC 5545 p.20

validate

protected void validate(List<ICalComponent> components,
                        List<String> warnings)
Description copied from class: ICalProperty
Checks the property for data consistency problems or deviations from the spec. Meant to be overridden by child classes that wish to provide validation logic.

Overrides:
validate in class ICalProperty
Parameters:
components - the hierarchy of components that the property belongs to
warnings - the list to add the warnings to


Copyright © 2013 Michael Angstadt. All Rights Reserved.