KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > directwebremoting > extend > Replies


1 /*
2  * Copyright 2005 Joe Walker
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package org.directwebremoting.extend;
17
18 import java.util.ArrayList JavaDoc;
19 import java.util.List JavaDoc;
20
21 /**
22  * The request made by the browser which consists of a number of function call
23  * requests and some associated information like the request mode (XHR or
24  * iframe).
25  * @author Joe Walker [joe at getahead dot ltd dot uk]
26  */

27 public class Replies
28 {
29     /**
30      * @param batchId The batchId to set.
31      */

32     public Replies(String JavaDoc batchId)
33     {
34         this.batchId = batchId;
35     }
36
37     /**
38      * How many replies are there is this request
39      * @return The total number of replies
40      */

41     public int getReplyCount()
42     {
43         return replies.size();
44     }
45
46     /**
47      * @param index The index (starts at 0) of the reply to fetch
48      * @return Returns the replies.
49      */

50     public Reply getReply(int index)
51     {
52         return (Reply) replies.get(index);
53     }
54
55     /**
56      * Add a reply to the collection of replies we are about to make
57      * @param reply The reply to add
58      */

59     public void addReply(Reply reply)
60     {
61         replies.add(reply);
62     }
63
64     /**
65      * @param batchId The batchId to set.
66      */

67     public void setBatchId(String JavaDoc batchId)
68     {
69         this.batchId = batchId;
70     }
71
72     /**
73      * @return Returns the batchId.
74      */

75     public String JavaDoc getBatchId()
76     {
77         return batchId;
78     }
79
80     private String JavaDoc batchId = null;
81
82     /**
83      * The collection of Replies that we should execute
84      */

85     private List JavaDoc replies = new ArrayList JavaDoc();
86 }
87
Popular Tags