KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > fractal > gui > model > Interface


1 /***
2  * FractalGUI: a graphical tool to edit Fractal component configurations.
3  * Copyright (C) 2003 France Telecom R&D
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18  *
19  * Contact: fractal@objectweb.org
20  *
21  * Authors: Eric Bruneton, Patrice Fauvel
22  */

23
24 package org.objectweb.fractal.gui.model;
25
26 import java.util.List JavaDoc;
27
28 /**
29  * A component interface.
30  */

31
32 public interface Interface {
33
34   /**
35    * The {@link #getStatus status} flags corresponding to a valid interface.
36    */

37
38   long OK = 0;
39
40   /**
41    * A {@link #getStatus status} flag indicating that the interface's name is
42    * missing.
43    */

44
45   long NAME_MISSING = 1;
46
47   /**
48    * A {@link #getStatus status} flag indicating that the interface's name is
49    * already used by another interface.
50    */

51
52   long NAME_ALREADY_USED = 1 << 1;
53
54   /**
55    * A {@link #getStatus status} flag indicating that the interface's signature
56    * is missing.
57    */

58
59   long SIGNATURE_MISSING = 1 << 2;
60
61   /**
62    * A {@link #getStatus status} flag indicating that the Java interface
63    * designated by the interface's signature cannot be found.
64    */

65
66   long SIGNATURE_CLASS_NOT_FOUND = 1 << 3;
67
68   /**
69    * A {@link #getStatus status} flag indicating that the Java interface
70    * designated by the interface's signature is invalid.
71    */

72
73   long SIGNATURE_CLASS_INVALID = 1 << 4;
74
75   /**
76    * A {@link #getStatus status} flag indicating that this mandatory interface
77    * is not bound.
78    */

79
80   long MANDATORY_INTERFACE_NOT_BOUND = 1 << 5;
81
82   /**
83    * Returns the component that owns this interface.
84    *
85    * @return the component that owns this interface.
86    */

87
88   Component getOwner ();
89
90   /**
91    * Returns the status of this interface.
92    *
93    * @return the status flags of this interface. Each flag, i.e., each bit of
94    * the returned value is independent from the other, and indicates an
95    * error if it is set.
96    * @see #setStatus
97    */

98
99   long getStatus ();
100
101   /**
102    * Sets the status of this interface. <i>This method is reserved for model
103    * providers, and must not be called by model users</i>.
104    *
105    * @param status the new status of this interface.
106    * @see #getStatus
107    */

108
109   void setStatus (long status);
110
111   /**
112    * Returns the name of this interface.
113    *
114    * @return the name of this interface.
115    * @see #setName
116    */

117
118   String JavaDoc getName ();
119
120   /**
121    * Sets the name of this interface. This method notifies the configuration
122    * listeners, via the {@link ConfigurationListener#interfaceNameChanged
123    * interfaceNameChanged} method.
124    *
125    * @param name the new interface name.
126    * @see #getName
127    */

128
129   void setName (String JavaDoc name);
130
131   /**
132    * Returns the signature of this interface.
133    *
134    * @return the signature of this interface.
135    * @see #setSignature
136    */

137
138   String JavaDoc getSignature ();
139
140   /**
141    * Sets the signature of this interface. This method notifies the
142    * configuration listeners, via the {@link
143    * ConfigurationListener#interfaceSignatureChanged interfaceSignatureChanged}
144    * method.
145    *
146    * @param signature the new interface signature.
147    * @see #getSignature
148    */

149
150   void setSignature (String JavaDoc signature);
151
152   /**
153    * Returns <tt>true</tt> if this interface is an internal interface.
154    *
155    * @return <tt>true</tt> if this interface is an internal interface,
156    * <tt>false</tt> otherwise.
157    */

158
159   boolean isInternal ();
160
161   /**
162    * Returns the contingency of this interface.
163    *
164    * @return <tt>true</tt> if this interface is optional, <tt>false</tt>
165    * otherwise.
166    */

167
168   boolean isOptional ();
169
170   /**
171    * Sets the contingency of this interface. This method notifies the
172    * configuration listeners, via the {@link
173    * ConfigurationListener#interfaceContingencyChanged
174    * interfaceContingencyChanged} method.
175    *
176    * @param isOptional the new interface contingency.
177    */

178
179   void setIsOptional (boolean isOptional);
180
181   /**
182    * Returns the cardinality of this interface.
183    *
184    * @return <tt>true</tt> if this interface is a collection interface,
185    * <tt>false</tt> otherwise.
186    */

187
188   boolean isCollection ();
189
190   /**
191    * Sets the cadrinality of this interface. This method notifies the
192    * configuration listeners, via the {@link
193    * ConfigurationListener#interfaceCardinalityChanged
194    * interfaceCardinalityChanged} method.
195    *
196    * @param isCollection the new interface cardinality.
197    */

198
199   void setIsCollection (boolean isCollection);
200
201   /**
202    * Returns the master collection interface of this interface.
203    *
204    * @return the master collection interface of this interface, or <tt>null</tt>
205    * if this interface is not a slave collection interface.
206    */

207
208   Interface getMasterCollectionInterface ();
209
210   /**
211    * Returns the slave collection interfaces of this interface.
212    *
213    * @return an unmodifiable list of the slave collection interfaces of this
214    * interface. This list is empty if this interface is not a master
215    * collection interface.
216    */

217
218   List JavaDoc getSlaveCollectionInterfaces ();
219
220   /**
221    * Returns the complementary interface of this interface.
222    *
223    * @return the complementary interface of this interface.
224    */

225
226   Interface getComplementaryInterface ();
227
228   /**
229    * Return the master interface of this interface.
230    *
231    * @return the master interface of this interface, or <tt>null</tt> if this
232    * interface is not an interface of a slave component.
233    */

234
235   Interface getMasterInterface ();
236 }
237
Popular Tags