01: /*
02: * Copyright (c) 2004-2006, Jean-François Brazeau. All rights reserved.
03: *
04: * Redistribution and use in source and binary forms, with or without
05: * modification, are permitted provided that the following conditions are met:
06: *
07: * 1. Redistributions of source code must retain the above copyright notice,
08: * this list of conditions and the following disclaimer.
09: *
10: * 2. Redistributions in binary form must reproduce the above copyright
11: * notice, this list of conditions and the following disclaimer in the
12: * documentation and/or other materials provided with the distribution.
13: *
14: * 3. The name of the author may not be used to endorse or promote products
15: * derived from this software without specific prior written permission.
16: *
17: * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18: * IMPLIEDWARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19: * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20: * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21: * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
22: * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
23: * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24: * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
25: * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
26: * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27: */
28: package jfb.tools.activitymgr.ui.util;
29:
30: import jfb.tools.activitymgr.core.beans.Contribution;
31: import jfb.tools.activitymgr.core.beans.Task;
32:
33: /**
34: * Contributions associées à une tache donnée sur une semaine.
35: */
36: public class WeekContributions {
37:
38: /** La tache associée à la liste de contributions */
39: private Task task;
40:
41: /** La liste des contributions */
42: private Contribution[] contributions = new Contribution[7];
43:
44: /**
45: * Retourne la contribution du jour de la semaine spécifié.
46: * @param day le jour de la semaine.
47: * @return la contribution du jour de la semaine spécifié.
48: */
49: public Contribution getContribution(int day) {
50: return contributions[day];
51: }
52:
53: /**
54: * Définit la contribution d'un jour de la semaine.
55: * @param day le numéro du jour de la semaine.
56: * @param contribution les nouvelles contributions.
57: */
58: public void setContribution(int day, Contribution contribution) {
59: contributions[day] = contribution;
60: }
61:
62: /**
63: * @return la tache pour cette contribution sur une semaine.
64: */
65: public Task getTask() {
66: return task;
67: }
68:
69: /**
70: * Définit la tache pour cette contribution sur une semaine.
71: * @param task la nouvelle tache.
72: */
73: public void setTask(Task task) {
74: this .task = task;
75: }
76:
77: /**
78: * @return les contributions de la semaine.
79: */
80: public Contribution[] getContributions() {
81: return contributions;
82: }
83:
84: /**
85: * Définit les contributions de la semaine.
86: * @param contributions les nouvelles contributions.
87: */
88: public void setContributions(Contribution[] contributions) {
89: this.contributions = contributions;
90: }
91:
92: }
|