View Javadoc
1   // =================== DO NOT EDIT THIS FILE ====================
2   // Generated by Modello 2.3.0,
3   // any modifications will be overwritten.
4   // ==============================================================
5   
6   package org.codehaus.modello.test.features;
7   
8     //---------------------------------/
9    //- Imported classes and packages -/
10  //---------------------------------/
11  
12  import java.util.Collection;
13  import org.codehaus.modello.test.features.other.PackageNameFeature;
14  import org.codehaus.modello.test.features.other.SubInterfaceInPackage;
15  
16  /**
17   * 
18   *         <code>&lt;field&gt;&lt;type&gt;<i>chose a
19   * type</i>&lt;/type&gt;&lt;field&gt;</code>:
20   *         Test of every simple types supported.
21   *       
22   * 
23   * @version $Revision$ $Date$
24   */
25  @SuppressWarnings( "all" )
26  public class AssociationFeatures
27      implements java.io.Serializable
28  {
29  
30        //--------------------------/
31       //- Class/Member Variables -/
32      //--------------------------/
33  
34      /**
35       * Field listReferences.
36       */
37      private java.util.List<Reference> listReferences;
38  
39      /**
40       * Field setReferences.
41       */
42      private java.util.Set<Reference> setReferences;
43  
44      /**
45       * Field listStrings.
46       */
47      private java.util.List<String> listStrings;
48  
49      /**
50       * Field setStrings.
51       */
52      private java.util.Set<String> setStrings;
53  
54      /**
55       * Field properties.
56       */
57      private java.util.Properties properties;
58  
59      /**
60       * Field bidi.
61       */
62      private Bidirectional bidi;
63  
64      /**
65       * Field listOfBidis.
66       */
67      private java.util.List<BidiInList> listOfBidis;
68  
69      /**
70       * Field setOfBidis.
71       */
72      private java.util.Set<BidiInSet> setOfBidis;
73  
74  
75        //-----------/
76       //- Methods -/
77      //-----------/
78  
79      /**
80       * Method addListOfBidi.
81       * 
82       * @param bidiInList a bidiInList object.
83       */
84      public void addListOfBidi( BidiInList bidiInList )
85      {
86          getListOfBidis().add( bidiInList );
87          bidiInList.createAssociationFeaturesAssociation( this );
88      } //-- void addListOfBidi( BidiInList )
89  
90      /**
91       * Method addListReference.
92       * 
93       * @param reference a reference object.
94       */
95      public void addListReference( Reference reference )
96      {
97          getListReferences().add( reference );
98      } //-- void addListReference( Reference )
99  
100     /**
101      * Method addListString.
102      * 
103      * @param string a string object.
104      */
105     public void addListString( String string )
106     {
107         getListStrings().add( string );
108     } //-- void addListString( String )
109 
110     /**
111      * Method addProperty.
112      * 
113      * @param key a key object.
114      * @param value a value object.
115      */
116     public void addProperty( String key, String value )
117     {
118         getProperties().put( key, value );
119     } //-- void addProperty( String, String )
120 
121     /**
122      * Method addSetOfBidi.
123      * 
124      * @param bidiInSet a bidiInSet object.
125      */
126     public void addSetOfBidi( BidiInSet bidiInSet )
127     {
128         getSetOfBidis().add( bidiInSet );
129         bidiInSet.createAssociationFeaturesAssociation( this );
130     } //-- void addSetOfBidi( BidiInSet )
131 
132     /**
133      * Method addSetReference.
134      * 
135      * @param reference a reference object.
136      */
137     public void addSetReference( Reference reference )
138     {
139         getSetReferences().add( reference );
140     } //-- void addSetReference( Reference )
141 
142     /**
143      * Method addSetString.
144      * 
145      * @param string a string object.
146      */
147     public void addSetString( String string )
148     {
149         getSetStrings().add( string );
150     } //-- void addSetString( String )
151 
152     /**
153      * Method breakBidiInListAssociation.
154      * 
155      * @param bidiInList a bidiInList object.
156      */
157     public void breakBidiInListAssociation( BidiInList bidiInList )
158     {
159         if ( !getListOfBidis().contains( bidiInList ) )
160         {
161             throw new IllegalStateException( "bidiInList isn't associated." );
162         }
163 
164         getListOfBidis().remove( bidiInList );
165     } //-- void breakBidiInListAssociation( BidiInList )
166 
167     /**
168      * Method breakBidiInSetAssociation.
169      * 
170      * @param bidiInSet a bidiInSet object.
171      */
172     public void breakBidiInSetAssociation( BidiInSet bidiInSet )
173     {
174         if ( !getSetOfBidis().contains( bidiInSet ) )
175         {
176             throw new IllegalStateException( "bidiInSet isn't associated." );
177         }
178 
179         getSetOfBidis().remove( bidiInSet );
180     } //-- void breakBidiInSetAssociation( BidiInSet )
181 
182     /**
183      * Method breakBidirectionalAssociation.
184      * 
185      * @param bidirectional a bidirectional object.
186      */
187     public void breakBidirectionalAssociation( Bidirectional bidirectional )
188     {
189         if ( this.bidi != bidirectional )
190         {
191             throw new IllegalStateException( "bidirectional isn't associated." );
192         }
193 
194         this.bidi = null;
195     } //-- void breakBidirectionalAssociation( Bidirectional )
196 
197     /**
198      * Method createBidiInListAssociation.
199      * 
200      * @param bidiInList a bidiInList object.
201      */
202     public void createBidiInListAssociation( BidiInList bidiInList )
203     {
204         Collection listOfBidis = getListOfBidis();
205 
206         if ( listOfBidis.contains( bidiInList ) )
207         {
208             throw new IllegalStateException( "bidiInList is already assigned." );
209         }
210 
211         listOfBidis.add( bidiInList );
212     } //-- void createBidiInListAssociation( BidiInList )
213 
214     /**
215      * Method createBidiInSetAssociation.
216      * 
217      * @param bidiInSet a bidiInSet object.
218      */
219     public void createBidiInSetAssociation( BidiInSet bidiInSet )
220     {
221         Collection setOfBidis = getSetOfBidis();
222 
223         if ( setOfBidis.contains( bidiInSet ) )
224         {
225             throw new IllegalStateException( "bidiInSet is already assigned." );
226         }
227 
228         setOfBidis.add( bidiInSet );
229     } //-- void createBidiInSetAssociation( BidiInSet )
230 
231     /**
232      * Method createBidirectionalAssociation.
233      * 
234      * @param bidirectional a bidirectional object.
235      */
236     public void createBidirectionalAssociation( Bidirectional bidirectional )
237     {
238         if ( this.bidi != null )
239         {
240             breakBidirectionalAssociation( this.bidi );
241         }
242 
243         this.bidi = bidirectional;
244     } //-- void createBidirectionalAssociation( Bidirectional )
245 
246     /**
247      * Get the bidi field.
248      * 
249      * @return Bidirectional
250      */
251     public Bidirectional getBidi()
252     {
253         return this.bidi;
254     } //-- Bidirectional getBidi()
255 
256     /**
257      * Method getListOfBidis.
258      * 
259      * @return List
260      */
261     public java.util.List<BidiInList> getListOfBidis()
262     {
263         if ( this.listOfBidis == null )
264         {
265             this.listOfBidis = new java.util.ArrayList<BidiInList>();
266         }
267 
268         return this.listOfBidis;
269     } //-- java.util.List<BidiInList> getListOfBidis()
270 
271     /**
272      * Method getListReferences.
273      * 
274      * @return List
275      */
276     public java.util.List<Reference> getListReferences()
277     {
278         if ( this.listReferences == null )
279         {
280             this.listReferences = new java.util.ArrayList<Reference>();
281         }
282 
283         return this.listReferences;
284     } //-- java.util.List<Reference> getListReferences()
285 
286     /**
287      * Method getListStrings.
288      * 
289      * @return List
290      */
291     public java.util.List<String> getListStrings()
292     {
293         if ( this.listStrings == null )
294         {
295             this.listStrings = new java.util.ArrayList<String>();
296         }
297 
298         return this.listStrings;
299     } //-- java.util.List<String> getListStrings()
300 
301     /**
302      * Method getProperties.
303      * 
304      * @return Properties
305      */
306     public java.util.Properties getProperties()
307     {
308         if ( this.properties == null )
309         {
310             this.properties = new org.codehaus.modello.OrderedProperties();
311         }
312 
313         return this.properties;
314     } //-- java.util.Properties getProperties()
315 
316     /**
317      * Method getSetOfBidis.
318      * 
319      * @return Set
320      */
321     public java.util.Set<BidiInSet> getSetOfBidis()
322     {
323         if ( this.setOfBidis == null )
324         {
325             this.setOfBidis = new java.util.HashSet<BidiInSet>();
326         }
327 
328         return this.setOfBidis;
329     } //-- java.util.Set<BidiInSet> getSetOfBidis()
330 
331     /**
332      * Method getSetReferences.
333      * 
334      * @return Set
335      */
336     public java.util.Set<Reference> getSetReferences()
337     {
338         if ( this.setReferences == null )
339         {
340             this.setReferences = new java.util.HashSet<Reference>();
341         }
342 
343         return this.setReferences;
344     } //-- java.util.Set<Reference> getSetReferences()
345 
346     /**
347      * Method getSetStrings.
348      * 
349      * @return Set
350      */
351     public java.util.Set<String> getSetStrings()
352     {
353         if ( this.setStrings == null )
354         {
355             this.setStrings = new java.util.HashSet<String>();
356         }
357 
358         return this.setStrings;
359     } //-- java.util.Set<String> getSetStrings()
360 
361     /**
362      * Method removeListOfBidi.
363      * 
364      * @param bidiInList a bidiInList object.
365      */
366     public void removeListOfBidi( BidiInList bidiInList )
367     {
368         bidiInList.breakAssociationFeaturesAssociation( this );
369         getListOfBidis().remove( bidiInList );
370     } //-- void removeListOfBidi( BidiInList )
371 
372     /**
373      * Method removeListReference.
374      * 
375      * @param reference a reference object.
376      */
377     public void removeListReference( Reference reference )
378     {
379         getListReferences().remove( reference );
380     } //-- void removeListReference( Reference )
381 
382     /**
383      * Method removeListString.
384      * 
385      * @param string a string object.
386      */
387     public void removeListString( String string )
388     {
389         getListStrings().remove( string );
390     } //-- void removeListString( String )
391 
392     /**
393      * Method removeSetOfBidi.
394      * 
395      * @param bidiInSet a bidiInSet object.
396      */
397     public void removeSetOfBidi( BidiInSet bidiInSet )
398     {
399         bidiInSet.breakAssociationFeaturesAssociation( this );
400         getSetOfBidis().remove( bidiInSet );
401     } //-- void removeSetOfBidi( BidiInSet )
402 
403     /**
404      * Method removeSetReference.
405      * 
406      * @param reference a reference object.
407      */
408     public void removeSetReference( Reference reference )
409     {
410         getSetReferences().remove( reference );
411     } //-- void removeSetReference( Reference )
412 
413     /**
414      * Method removeSetString.
415      * 
416      * @param string a string object.
417      */
418     public void removeSetString( String string )
419     {
420         getSetStrings().remove( string );
421     } //-- void removeSetString( String )
422 
423     /**
424      * Set the bidi field.
425      * 
426      * @param bidi a bidi object.
427      */
428     public void setBidi( Bidirectional bidi )
429     {
430         if ( this.bidi != null )
431         {
432             this.bidi.breakAssociationFeaturesAssociation( this );
433         }
434 
435         this.bidi = bidi;
436 
437         if ( bidi != null )
438         {
439             this.bidi.createAssociationFeaturesAssociation( this );
440         }
441     } //-- void setBidi( Bidirectional )
442 
443     /**
444      * Set the listOfBidis field.
445      * 
446      * @param listOfBidis a listOfBidis object.
447      */
448     public void setListOfBidis( java.util.List<BidiInList> listOfBidis )
449     {
450         this.listOfBidis = listOfBidis;
451     } //-- void setListOfBidis( java.util.List )
452 
453     /**
454      * Set the listReferences field.
455      * 
456      * @param listReferences a listReferences object.
457      */
458     public void setListReferences( java.util.List<Reference> listReferences )
459     {
460         this.listReferences = listReferences;
461     } //-- void setListReferences( java.util.List )
462 
463     /**
464      * Set the listStrings field.
465      * 
466      * @param listStrings a listStrings object.
467      */
468     public void setListStrings( java.util.List<String> listStrings )
469     {
470         this.listStrings = listStrings;
471     } //-- void setListStrings( java.util.List )
472 
473     /**
474      * Set the properties field.
475      * 
476      * @param properties a properties object.
477      */
478     public void setProperties( java.util.Properties properties )
479     {
480         this.properties = properties;
481     } //-- void setProperties( java.util.Properties )
482 
483     /**
484      * Set the setOfBidis field.
485      * 
486      * @param setOfBidis a setOfBidis object.
487      */
488     public void setSetOfBidis( java.util.Set<BidiInSet> setOfBidis )
489     {
490         this.setOfBidis = setOfBidis;
491     } //-- void setSetOfBidis( java.util.Set )
492 
493     /**
494      * Set the setReferences field.
495      * 
496      * @param setReferences a setReferences object.
497      */
498     public void setSetReferences( java.util.Set<Reference> setReferences )
499     {
500         this.setReferences = setReferences;
501     } //-- void setSetReferences( java.util.Set )
502 
503     /**
504      * Set the setStrings field.
505      * 
506      * @param setStrings a setStrings object.
507      */
508     public void setSetStrings( java.util.Set<String> setStrings )
509     {
510         this.setStrings = setStrings;
511     } //-- void setSetStrings( java.util.Set )
512 
513 }