01: package com.technoetic.xplanner.domain;
02:
03: import java.util.Arrays;
04: import java.util.List;
05:
06: public class TaskStatus implements Comparable {
07: public static final TaskStatus STARTED = new TaskStatus("S");
08: public static final TaskStatus NON_STARTED = new TaskStatus("");
09: public static final TaskStatus COMPLETED = new TaskStatus("C");
10: public static final List statusOrdering = Arrays
11: .asList(new TaskStatus[] { STARTED, NON_STARTED, COMPLETED });
12:
13: private final String status;
14:
15: private TaskStatus(String status) {
16: this .status = status;
17: }
18:
19: public String toString() {
20: return status;
21: }
22:
23: public int compareTo(Object o) {
24: return statusOrdering.indexOf(this) - statusOrdering.indexOf(o);
25: }
26: }
|