org.schmant.task.tp.taskref
Class TaskCategory

java.lang.Object
  extended by org.schmant.task.tp.taskref.TaskCategory
All Implemented Interfaces:
Comparable<TaskCategory>

public class TaskCategory
extends Object
implements Comparable<TaskCategory>

This is an immutable object representing a task category. It contains a name, a descriptive text and an abbreviation. The abbreviation for each task category must be unique.

This object is Comparable with other TaskCategory objects. It compares the task category names.

Since:
0.8
Author:
Karl Gustafsson
Task_package:
org.schmant.task.taskpackage

Constructor Summary
TaskCategory(String name, String abbreviation, String description)
           
 
Method Summary
 int compareTo(TaskCategory tc)
          This compares the category's name, making it easy to sort categories in alphabetical order.
 boolean equals(Object o)
          Two task categories are equal if they have the same abbreviations.
 String getAbbreviation()
          Get the task's abbreviation.
 String getDescription()
          Get a descriptive text for the task.
 String getName()
          Get the category's name.
 int hashCode()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TaskCategory

public TaskCategory(String name,
                    String abbreviation,
                    String description)
Method Detail

getName

public String getName()
Get the category's name.

Returns:
The category's name.

getAbbreviation

public String getAbbreviation()
Get the task's abbreviation. This is the text used by the task factory reference documentation to categorize the task factory.

Returns:
The task's abbreviation.

getDescription

public String getDescription()
Get a descriptive text for the task.

Returns:
A descriptive text for the task.

compareTo

public int compareTo(TaskCategory tc)
This compares the category's name, making it easy to sort categories in alphabetical order.

Specified by:
compareTo in interface Comparable<TaskCategory>

equals

public boolean equals(Object o)
Two task categories are equal if they have the same abbreviations.

Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object