001: /*
002: * Lucane - a collaborative platform
003: * Copyright (C) 2004 Jonathan Riboux <jonathan.riboux@wanadoo.Fr>
004: *
005: * This library is free software; you can redistribute it and/or
006: * modify it under the terms of the GNU Lesser General Public
007: * License as published by the Free Software Foundation; either
008: * version 2.1 of the License, or (at your option) any later version.
009: *
010: * This library is distributed in the hope that it will be useful,
011: * but WITHOUT ANY WARRANTY; without even the implied warranty of
012: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
013: * Lesser General Public License for more details.
014: *
015: * You should have received a copy of the GNU Lesser General Public
016: * License along with this library; if not, write to the Free Software
017: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
018: */
019:
020: package org.lucane.applications.todolist;
021:
022: import java.io.Serializable;
023: import java.util.Date;
024:
025: public class TodolistItem implements Serializable {
026: private int id;
027: private int parentTodolistId;
028: private String name;
029: private String comment;
030: private int priority;
031: private boolean complete;
032: private Date startDate;
033: private Date endDate;
034: private Date estimatedStartDate;
035: private Date estimatedEndDate;
036:
037: public static final int PRIORITY_LOW = 0;
038: public static final int PRIORITY_MEDIUM = 1;
039: public static final int PRIORITY_HIGH = 2;
040: private static String[] priorityLabels = { "low", "medium", "high" };
041: private static String[] completeLabels = { "false", "true" };
042:
043: public TodolistItem(int parentTodolistId, String name,
044: String comment, int priority, Date startDate, Date endDate,
045: Date estimatedStartDate, Date estimatedEndDate) {
046: this (-1, parentTodolistId, name, comment, priority, false,
047: startDate, endDate, estimatedStartDate,
048: estimatedEndDate);
049: }
050:
051: public TodolistItem(int parentTodolistId, String name,
052: String comment, int priority, boolean complete,
053: Date startDate, Date endDate, Date estimatedStartDate,
054: Date estimatedEndDate) {
055: this (-1, parentTodolistId, name, comment, priority, complete,
056: startDate, endDate, estimatedStartDate,
057: estimatedEndDate);
058: }
059:
060: public TodolistItem(int id, int parentTodolistId, String name,
061: String comment, int priority, boolean complete,
062: Date startDate, Date endDate, Date estimatedStartDate,
063: Date estimatedEndDate) {
064: this .id = id;
065: this .parentTodolistId = parentTodolistId;
066: this .name = name;
067: this .comment = comment;
068: this .priority = priority;
069: this .startDate = startDate;
070: this .endDate = endDate;
071: this .estimatedStartDate = estimatedStartDate;
072: this .estimatedEndDate = estimatedEndDate;
073: this .complete = complete;
074: }
075:
076: public int getId() {
077: return id;
078: }
079:
080: public boolean isCompleted() {
081: return complete;
082: }
083:
084: public String getComment() {
085: return comment;
086: }
087:
088: public String getName() {
089: return name;
090: }
091:
092: public int getPriority() {
093: return priority;
094: }
095:
096: public int getParentTodolistId() {
097: return parentTodolistId;
098: }
099:
100: public void setId(int i) {
101: id = i;
102: }
103:
104: public void setComplete(boolean b) {
105: complete = b;
106: }
107:
108: public void setComment(String string) {
109: comment = string;
110: }
111:
112: public void setName(String string) {
113: name = string;
114: }
115:
116: public void setPriority(int i) {
117: priority = i;
118: }
119:
120: public void setParentTodolistId(int i) {
121: parentTodolistId = i;
122: }
123:
124: public String toString() {
125: return getName();
126: }
127:
128: public static String[] getPriorityLabels() {
129: return priorityLabels;
130: }
131:
132: public static void setPriorityLabels(String[] priorityLabels) {
133: TodolistItem.priorityLabels = priorityLabels;
134: }
135:
136: public static String[] getCompleteLabels() {
137: return completeLabels;
138: }
139:
140: public static void setCompleteLabels(String[] completeLabels) {
141: TodolistItem.completeLabels = completeLabels;
142: }
143:
144: public Date getEndDate() {
145: return endDate;
146: }
147:
148: public void setEndDate(Date endDate) {
149: this .endDate = endDate;
150: }
151:
152: public Date getEstimatedEndDate() {
153: return estimatedEndDate;
154: }
155:
156: public void setEstimatedEndDate(Date estimatedEndDate) {
157: this .estimatedEndDate = estimatedEndDate;
158: }
159:
160: public Date getEstimatedStartDate() {
161: return estimatedStartDate;
162: }
163:
164: public void setEstimatedStartDate(Date estimatedStartDate) {
165: this .estimatedStartDate = estimatedStartDate;
166: }
167:
168: public Date getStartDate() {
169: return startDate;
170: }
171:
172: public void setStartDate(Date startDate) {
173: this.startDate = startDate;
174: }
175: }
|