biweekly.property
Class Priority

java.lang.Object
  extended by biweekly.property.ICalProperty
      extended by biweekly.property.ValuedProperty<Integer>
          extended by biweekly.property.IntegerProperty
              extended by biweekly.property.Priority

public class Priority
extends IntegerProperty

Defines the priority of an event or to-do task.

Examples:

 //highest
 Priority priority = new Priority(1);
 
 //lowest
 Priority priority = new Priority(9);
 
 VTodo todo = new VTodo();
 todo.setPriority(1);
 

Author:
Michael Angstadt
Specification Reference:
RFC 5545 p.89-90

Field Summary
 
Fields inherited from class biweekly.property.ValuedProperty
value
 
Fields inherited from class biweekly.property.ICalProperty
parameters
 
Constructor Summary
Priority(Integer priority)
          Creates a priority property.
 
Method Summary
 boolean isHigh()
          Determines if this priority is considered "high" priority.
 boolean isLow()
          Determines if this priority is considered "low" priority.
 boolean isMedium()
          Determines if this priority is considered "medium" priority.
 boolean isUndefined()
          Determines if this priority has an "undefined" value.
 String toCuaPriority()
          Converts this priority to its two-character CUA code.
 
Methods inherited from class biweekly.property.ValuedProperty
getValue, setValue, validate
 
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

Priority

public Priority(Integer priority)
Creates a priority property.

Parameters:
priority - the priority ("0" is undefined, "1" is the highest, "9" is the lowest)
Method Detail

isHigh

public boolean isHigh()
Determines if this priority is considered "high" priority.

Returns:
true if the priority is between 1 and 4, false if not

isMedium

public boolean isMedium()
Determines if this priority is considered "medium" priority.

Returns:
true if the priority is "5", false if not

isLow

public boolean isLow()
Determines if this priority is considered "low" priority.

Returns:
true if the priority is between 6 and 9, false if not

isUndefined

public boolean isUndefined()
Determines if this priority has an "undefined" value.

Returns:
true if the priority is "0", false if not

toCuaPriority

public String toCuaPriority()
Converts this priority to its two-character CUA code.

Returns:
the CUA code (e.g. "B1" for "4") or null if the priority cannot be converted to a CUA code


Copyright © 2013 Michael Angstadt. All Rights Reserved.