View Javadoc

1   /***
2    * ***************************************************************
3    * JADE - Java Agent DEvelopment Framework is a framework to develop
4    * multi-agent systems in compliance with the FIPA specifications.
5    * Copyright (C) 2000 CSELT S.p.A.
6    * 
7    * GNU Lesser General Public License
8    * 
9    * This library is free software; you can redistribute it and/or
10   * modify it under the terms of the GNU Lesser General Public
11   * License as published by the Free Software Foundation,
12   * version 2.1 of the License.
13   * 
14   * This library is distributed in the hope that it will be useful,
15   * but WITHOUT ANY WARRANTY; without even the implied warranty of
16   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17   * Lesser General Public License for more details.
18   * 
19   * You should have received a copy of the GNU Lesser General Public
20   * License along with this library; if not, write to the
21   * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
22   * Boston, MA  02111-1307, USA.
23   * **************************************************************
24   */
25  package JADE_SL.acl;
26  
27  import JADE_SL.*;
28  import JADE_SL.onto.*;
29  
30  import zeus.concepts.FIPA_AID_Address;
31  
32  import java.util.Iterator;
33  import java.util.List;
34  import java.util.ArrayList;
35  import java.lang.reflect.*;
36  /***
37   * @author Federico Bergenti - Universita` di Parma
38   */
39  public class CommunicativeActBase implements AgentAction {
40      private AID  sender = null;
41      private List receivers = new ArrayList();
42  
43      /***
44       * Constructor.
45       *
46       */
47      public CommunicativeActBase() {}
48  
49      /***
50       * Sets the <code>sender</code>.
51       *
52       * @param sender the sender.
53       *
54       */
55      public void setSender(AID sender) {
56          this.sender = sender;
57      } 
58  
59      /***
60       * Retrieves the <code>sender</code>.
61       *
62       * @return the sender.
63       *
64       */
65      public AID getSender() {
66          return sender;
67      } 
68  
69      /***
70       * Clears the receiver list.
71       *
72       * @param receivers the receivers.
73       *
74       */
75      public void clearAllReceiver() {
76          receivers.clear();
77      } 
78  
79      /***
80       * Retrieves the receivers.
81       *
82       * @return the receivers.
83       *
84       */
85      public Iterator getAllReceiver() {
86          return receivers.iterator();
87      } 
88  
89      /***
90       * Add a new receiver to the list.
91       *
92       * @param aid the AID of the receiver.
93       *
94       */
95      public void addReceiver(AID aid) {
96          receivers.add(aid);
97      } 
98  
99  }
100