KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > lucane > applications > todolist > TodolistItem


1 /*
2  * Lucane - a collaborative platform
3  * Copyright (C) 2004 Jonathan Riboux <jonathan.riboux@wanadoo.Fr>
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18  */

19
20 package org.lucane.applications.todolist;
21
22 import java.io.Serializable JavaDoc;
23 import java.util.Date JavaDoc;
24
25 public class TodolistItem implements Serializable JavaDoc {
26     private int id;
27     private int parentTodolistId;
28     private String JavaDoc name;
29     private String JavaDoc comment;
30     private int priority;
31     private boolean complete;
32     private Date JavaDoc startDate;
33     private Date JavaDoc endDate;
34     private Date JavaDoc estimatedStartDate;
35     private Date JavaDoc estimatedEndDate;
36
37     public static final int PRIORITY_LOW = 0;
38     public static final int PRIORITY_MEDIUM = 1;
39     public static final int PRIORITY_HIGH = 2;
40     private static String JavaDoc[] priorityLabels = {"low", "medium", "high"};
41     private static String JavaDoc[] completeLabels = {"false", "true"};
42
43     public TodolistItem(int parentTodolistId, String JavaDoc name, String JavaDoc comment, int priority, Date JavaDoc startDate, Date JavaDoc endDate, Date JavaDoc estimatedStartDate, Date JavaDoc estimatedEndDate) {
44         this(-1, parentTodolistId, name, comment, priority, false, startDate, endDate, estimatedStartDate, estimatedEndDate);
45     }
46
47     public TodolistItem(int parentTodolistId, String JavaDoc name, String JavaDoc comment, int priority, boolean complete, Date JavaDoc startDate, Date JavaDoc endDate, Date JavaDoc estimatedStartDate, Date JavaDoc estimatedEndDate) {
48         this(-1, parentTodolistId, name, comment, priority, complete, startDate, endDate, estimatedStartDate, estimatedEndDate);
49     }
50
51     public TodolistItem(int id, int parentTodolistId, String JavaDoc name, String JavaDoc comment, int priority, boolean complete, Date JavaDoc startDate, Date JavaDoc endDate, Date JavaDoc estimatedStartDate, Date JavaDoc estimatedEndDate) {
52         this.id = id;
53         this.parentTodolistId = parentTodolistId;
54         this.name = name;
55         this.comment = comment;
56         this.priority = priority;
57         this.startDate = startDate;
58         this.endDate = endDate;
59         this.estimatedStartDate = estimatedStartDate;
60         this.estimatedEndDate = estimatedEndDate;
61         this.complete = complete;
62     }
63
64     public int getId() {
65         return id;
66     }
67     public boolean isCompleted() {
68         return complete;
69     }
70     public String JavaDoc getComment() {
71         return comment;
72     }
73     public String JavaDoc getName() {
74         return name;
75     }
76     public int getPriority() {
77         return priority;
78     }
79     public int getParentTodolistId() {
80         return parentTodolistId;
81     }
82
83     public void setId(int i) {
84         id = i;
85     }
86     public void setComplete(boolean b) {
87         complete = b;
88     }
89     public void setComment(String JavaDoc string) {
90         comment = string;
91     }
92     public void setName(String JavaDoc string) {
93         name = string;
94     }
95     public void setPriority(int i) {
96         priority = i;
97     }
98     public void setParentTodolistId(int i) {
99         parentTodolistId = i;
100     }
101     public String JavaDoc toString() {
102         return getName();
103     }
104
105     public static String JavaDoc[] getPriorityLabels() {
106         return priorityLabels;
107     }
108     public static void setPriorityLabels(String JavaDoc[] priorityLabels) {
109         TodolistItem.priorityLabels = priorityLabels;
110     }
111
112     public static String JavaDoc[] getCompleteLabels() {
113         return completeLabels;
114     }
115     public static void setCompleteLabels(String JavaDoc[] completeLabels) {
116         TodolistItem.completeLabels = completeLabels;
117     }
118
119     public Date JavaDoc getEndDate() {
120         return endDate;
121     }
122     public void setEndDate(Date JavaDoc endDate) {
123         this.endDate = endDate;
124     }
125     public Date JavaDoc getEstimatedEndDate() {
126         return estimatedEndDate;
127     }
128     public void setEstimatedEndDate(Date JavaDoc estimatedEndDate) {
129         this.estimatedEndDate = estimatedEndDate;
130     }
131     public Date JavaDoc getEstimatedStartDate() {
132         return estimatedStartDate;
133     }
134     public void setEstimatedStartDate(Date JavaDoc estimatedStartDate) {
135         this.estimatedStartDate = estimatedStartDate;
136     }
137     public Date JavaDoc getStartDate() {
138         return startDate;
139     }
140     public void setStartDate(Date JavaDoc startDate) {
141         this.startDate = startDate;
142     }
143 }
144
Popular Tags