Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: com/clra/web/IEventList.java


1   /*
2    * Copyright (c) Carnegie Lake Rowing Association 2002. All rights reserved.
3    * Distributed under the GPL license. See doc/COPYING.
4    * $RCSfile: IEventList.java,v $
5    * $Date: 2003/02/26 03:38:46 $
6    * $Revision: 1.3 $
7    */
8   
9   package com.clra.web;
10  
11  import com.clra.util.ISerializableComparator;
12  import java.util.Iterator;
13  
14  /**
15   * Declares JSP attributes and bean properties for sorted lists of scheduled
16   * events. Views that implement this interface may be controlled via components
17   * such as MonthViewSelector and YearViewSelector.<p>
18   *
19   * For Java Server Pages, this interface declares four attributes that should
20   * be set and accessed within the scope of a request or session:<ul>
21   * <li><strong>restricted</strong>: is the view restricted to a range of
22   * dates within a particular month and year? [true,false]</li>
23   * <li><strong>month</strong>: if the view is restricted, the month to which
24   * it is restricted. A number between 0 (January) and 11 (December).</li>
25   * <li><strong>year</strong>: if the view is restricted, the year to which
26   * it is restricted. A four-digit year; e.g. 2002.</li>
27   * <li><strong>comparator</strong>: specifies a bean that implements
28   * <tt>java.util.Comparator</tt> which can compare instances of IScheduled.
29   * The current implementation of MonthViewSelector does not use the value
30   * of this attribute.</li>
31   * </ul>
32   *
33   * For beans, this interface declares five properties:<ul>
34   * <li><strong>restricted</strong>: read/write Boolean</li>
35   * <li><strong>month</strong>: read/write Integer, 0 - 11</li>
36   * <li><strong>year</strong>: read/write Integer, four digits</li>
37   * <li><strong>comparator</strong>: read/write java.util.Comparator, compares
38   * instances of IScheduled</li>
39   * <li><strong>iterator</strong>: read-only iterator of IScheduled
40   * instances</li>
41   * </ul>
42   *
43   * @version $Revision: 1.3 $ $Date: 2003/02/26 03:38:46 $
44   * @author <a href="mailto:rphall@pluto.njcc.com">Rick Hall</a>
45   */
46  public interface IEventList {
47  
48    /**
49     * Names an attribute within the scope of an HTTP request or session
50     * whose Boolean value indicates whether a list should be restricted to
51     * events that are scheduled to start within a particular month and year.
52     */
53    public final static String AN_ISRESTRICTED = "eventrestricted";
54  
55    /**
56     * Names an attribute within the scope of an HTTP request or session
57     * whose Integer value indicates the month to which a list should be
58     * restricted. Valid values are 0 (for January) through 11 (for December).
59     */
60    public final static String AN_MONTH = "eventmonth";
61  
62    /**
63     * Names an attribute within the scope of an HTTP request or session
64     * whose Integer value indicates the year to which a list should be
65     * restricted. Values values must have four digits; e.g. "2002".
66     */
67    public final static String AN_YEAR = "eventyear";
68  
69    /**
70     * Names an attribute within the scope of an HTTP request or session
71     * that holds a bean which implements <tt>java.util.Comparator</tt>.
72     * The comparator must be able to operate on instances of <tt>IScheduled</tt>.
73     * Current implementations ignore this attribute, but it is reserved for
74     * future enhancements.
75     */
76    public final static String AN_COMPARATOR = "eventcomparator";
77  
78    /**
79     * Returns an iterator over a collection of IScheduled beans.
80     * The behavior of the iterator is specified by setting 
81     * <tt>restricted</tt>, <tt>month</tt>, <tt>year</tt>, and
82     * <tt>comparator</tt> properties before the iterator is requested.
83     */
84    public Iterator getIterator() throws WebException;
85  
86    /**
87     * Returns a flag that indicates whether an iterator will be restricted
88     * to events that are scheduled to start within a particular month
89     * and year. A null value indicates behavior that is
90     * implementation-specific.
91     */
92    public Boolean getRestricted();
93  
94    /**
95     * Sets whether an iterator will be restricted to events that start
96     * within a particular month and year. A null value specifies
97     * implementation-specific behavior.
98     */
99    public void setRestricted( Boolean restricted );
100 
101   /**
102    * Returns the month to which an iteration is restricted (if it is
103    * restricted). Valid values are 0 (for January) through 11 (for December)
104    * plus <tt>null</tt> (for the current calendar month).
105    */
106   public Integer getMonth();
107 
108   /**
109    * Sets the month to which an iteration is restricted (if it is
110    * restricted). Valid values are 0 (for January) through 11 (for December)
111    * plus <tt>null</tt> (for the current calendar month).
112    */
113   public void setMonth( Integer month );
114 
115   /**
116    * Returns the year to which an iteration is restricted (if it is
117    * restricted). Valid values have four digits (e.g. "2002") or are
118    * <tt>null</tt> (for the current calendar year).
119    */
120   public Integer getYear();
121 
122   /**
123    * Sets the year to which an iteration is restricted (if it is
124    * restricted). Valid values have four digits (e.g. "2002") or are
125    * <tt>null</tt> (for the current calendar year).
126    */
127   public void setYear( Integer year );
128 
129   /**
130    * Returns the sort-order that an iterator will use. Valid comparators
131    * must be able to compare instances of IScheduled. A null comparator
132    * indicates the natural sort order of the events will be used.
133    */
134   public ISerializableComparator getComparator();
135 
136   /**
137    * Sets the sort-order that an iterator will use. Valid comparators
138    * must be able to compare instances of IScheduled. A null comparator
139    * indicates the natural sort order of the events will be used.
140    */
141   public void setComparator( ISerializableComparator comparator );
142 
143 } // IEventList
144 
145 /*
146  * $Log: IEventList.java,v $
147  * Revision 1.3  2003/02/26 03:38:46  rphall
148  * Added copyright and GPL license
149  *
150  * Revision 1.2  2002/02/18 18:06:00  rphall
151  * Ran dos2unix to remove ^M (carriage return) from end of lines
152  *
153  * Revision 1.1.1.1  2002/01/03 21:57:28  rphall
154  * Initial load, 5th try, Jan-03-2002 4:57 PM
155  *
156  * Revision 1.1  2001/12/31 15:10:39  rphall
157  * Renamed 'IEventViewList' to 'IEventList'
158  *
159  * Revision 1.3  2001/12/31 14:36:17  rphall
160  * Prefaced HTTP attribute names by 'event'
161  *
162  * Revision 1.2  2001/12/09 05:57:58  rphall
163  * Fixed setYear
164  *
165  * Revision 1.1  2001/12/08 23:23:57  rphall
166  * Declares attributes and properties for lists of events
167  *
168  */
169