001/*
002 =================== DO NOT EDIT THIS FILE ====================
003 Generated by Modello 1.9.2-SNAPSHOT,
004 any modifications will be overwritten.
005 ==============================================================
006 */
007
008package org.codehaus.modello.test.features;
009
010  //---------------------------------/
011 //- Imported classes and packages -/
012//---------------------------------/
013
014import java.util.Collection;
015import org.codehaus.modello.test.features.other.PackageNameFeature;
016import org.codehaus.modello.test.features.other.SubInterfaceInPackage;
017
018/**
019 * 
020 *         <code>&lt;field&gt;&lt;type&gt;<i>chose a
021 * type</i>&lt;/type&gt;&lt;field&gt;</code>:
022 *         Test of every simple types supported.
023 *       
024 * 
025 * @version $Revision$ $Date$
026 */
027@SuppressWarnings( "all" )
028public class AssociationFeatures
029    implements java.io.Serializable
030{
031
032      //--------------------------/
033     //- Class/Member Variables -/
034    //--------------------------/
035
036    /**
037     * Field listReferences.
038     */
039    private java.util.List<Reference> listReferences;
040
041    /**
042     * Field setReferences.
043     */
044    private java.util.Set<Reference> setReferences;
045
046    /**
047     * Field listStrings.
048     */
049    private java.util.List<String> listStrings;
050
051    /**
052     * Field setStrings.
053     */
054    private java.util.Set<String> setStrings;
055
056    /**
057     * Field properties.
058     */
059    private java.util.Properties properties;
060
061    /**
062     * Field bidi.
063     */
064    private Bidirectional bidi;
065
066    /**
067     * Field listOfBidis.
068     */
069    private java.util.List<BidiInList> listOfBidis;
070
071    /**
072     * Field setOfBidis.
073     */
074    private java.util.Set<BidiInSet> setOfBidis;
075
076
077      //-----------/
078     //- Methods -/
079    //-----------/
080
081    /**
082     * Method addListOfBidi.
083     * 
084     * @param bidiInList
085     */
086    public void addListOfBidi( BidiInList bidiInList )
087    {
088        getListOfBidis().add( bidiInList );
089        bidiInList.createAssociationFeaturesAssociation( this );
090    } //-- void addListOfBidi( BidiInList )
091
092    /**
093     * Method addListReference.
094     * 
095     * @param reference
096     */
097    public void addListReference( Reference reference )
098    {
099        getListReferences().add( reference );
100    } //-- void addListReference( Reference )
101
102    /**
103     * Method addListString.
104     * 
105     * @param string
106     */
107    public void addListString( String string )
108    {
109        getListStrings().add( string );
110    } //-- void addListString( String )
111
112    /**
113     * Method addProperty.
114     * 
115     * @param key
116     * @param value
117     */
118    public void addProperty( String key, String value )
119    {
120        getProperties().put( key, value );
121    } //-- void addProperty( String, String )
122
123    /**
124     * Method addSetOfBidi.
125     * 
126     * @param bidiInSet
127     */
128    public void addSetOfBidi( BidiInSet bidiInSet )
129    {
130        getSetOfBidis().add( bidiInSet );
131        bidiInSet.createAssociationFeaturesAssociation( this );
132    } //-- void addSetOfBidi( BidiInSet )
133
134    /**
135     * Method addSetReference.
136     * 
137     * @param reference
138     */
139    public void addSetReference( Reference reference )
140    {
141        getSetReferences().add( reference );
142    } //-- void addSetReference( Reference )
143
144    /**
145     * Method addSetString.
146     * 
147     * @param string
148     */
149    public void addSetString( String string )
150    {
151        getSetStrings().add( string );
152    } //-- void addSetString( String )
153
154    /**
155     * Method breakBidiInListAssociation.
156     * 
157     * @param bidiInList
158     */
159    public void breakBidiInListAssociation( BidiInList bidiInList )
160    {
161        if ( !getListOfBidis().contains( bidiInList ) )
162        {
163            throw new IllegalStateException( "bidiInList isn't associated." );
164        }
165
166        getListOfBidis().remove( bidiInList );
167    } //-- void breakBidiInListAssociation( BidiInList )
168
169    /**
170     * Method breakBidiInSetAssociation.
171     * 
172     * @param bidiInSet
173     */
174    public void breakBidiInSetAssociation( BidiInSet bidiInSet )
175    {
176        if ( !getSetOfBidis().contains( bidiInSet ) )
177        {
178            throw new IllegalStateException( "bidiInSet isn't associated." );
179        }
180
181        getSetOfBidis().remove( bidiInSet );
182    } //-- void breakBidiInSetAssociation( BidiInSet )
183
184    /**
185     * Method breakBidirectionalAssociation.
186     * 
187     * @param bidirectional
188     */
189    public void breakBidirectionalAssociation( Bidirectional bidirectional )
190    {
191        if ( this.bidi != bidirectional )
192        {
193            throw new IllegalStateException( "bidirectional isn't associated." );
194        }
195
196        this.bidi = null;
197    } //-- void breakBidirectionalAssociation( Bidirectional )
198
199    /**
200     * Method createBidiInListAssociation.
201     * 
202     * @param bidiInList
203     */
204    public void createBidiInListAssociation( BidiInList bidiInList )
205    {
206        Collection listOfBidis = getListOfBidis();
207
208        if ( listOfBidis.contains( bidiInList ) )
209        {
210            throw new IllegalStateException( "bidiInList is already assigned." );
211        }
212
213        listOfBidis.add( bidiInList );
214    } //-- void createBidiInListAssociation( BidiInList )
215
216    /**
217     * Method createBidiInSetAssociation.
218     * 
219     * @param bidiInSet
220     */
221    public void createBidiInSetAssociation( BidiInSet bidiInSet )
222    {
223        Collection setOfBidis = getSetOfBidis();
224
225        if ( setOfBidis.contains( bidiInSet ) )
226        {
227            throw new IllegalStateException( "bidiInSet is already assigned." );
228        }
229
230        setOfBidis.add( bidiInSet );
231    } //-- void createBidiInSetAssociation( BidiInSet )
232
233    /**
234     * Method createBidirectionalAssociation.
235     * 
236     * @param bidirectional
237     */
238    public void createBidirectionalAssociation( Bidirectional bidirectional )
239    {
240        if ( this.bidi != null )
241        {
242            breakBidirectionalAssociation( this.bidi );
243        }
244
245        this.bidi = bidirectional;
246    } //-- void createBidirectionalAssociation( Bidirectional )
247
248    /**
249     * Get the bidi field.
250     * 
251     * @return Bidirectional
252     */
253    public Bidirectional getBidi()
254    {
255        return this.bidi;
256    } //-- Bidirectional getBidi()
257
258    /**
259     * Method getListOfBidis.
260     * 
261     * @return List
262     */
263    public java.util.List<BidiInList> getListOfBidis()
264    {
265        if ( this.listOfBidis == null )
266        {
267            this.listOfBidis = new java.util.ArrayList<BidiInList>();
268        }
269
270        return this.listOfBidis;
271    } //-- java.util.List<BidiInList> getListOfBidis()
272
273    /**
274     * Method getListReferences.
275     * 
276     * @return List
277     */
278    public java.util.List<Reference> getListReferences()
279    {
280        if ( this.listReferences == null )
281        {
282            this.listReferences = new java.util.ArrayList<Reference>();
283        }
284
285        return this.listReferences;
286    } //-- java.util.List<Reference> getListReferences()
287
288    /**
289     * Method getListStrings.
290     * 
291     * @return List
292     */
293    public java.util.List<String> getListStrings()
294    {
295        if ( this.listStrings == null )
296        {
297            this.listStrings = new java.util.ArrayList<String>();
298        }
299
300        return this.listStrings;
301    } //-- java.util.List<String> getListStrings()
302
303    /**
304     * Method getProperties.
305     * 
306     * @return Properties
307     */
308    public java.util.Properties getProperties()
309    {
310        if ( this.properties == null )
311        {
312            this.properties = new org.codehaus.modello.OrderedProperties();
313        }
314
315        return this.properties;
316    } //-- java.util.Properties getProperties()
317
318    /**
319     * Method getSetOfBidis.
320     * 
321     * @return Set
322     */
323    public java.util.Set<BidiInSet> getSetOfBidis()
324    {
325        if ( this.setOfBidis == null )
326        {
327            this.setOfBidis = new java.util.HashSet<BidiInSet>();
328        }
329
330        return this.setOfBidis;
331    } //-- java.util.Set<BidiInSet> getSetOfBidis()
332
333    /**
334     * Method getSetReferences.
335     * 
336     * @return Set
337     */
338    public java.util.Set<Reference> getSetReferences()
339    {
340        if ( this.setReferences == null )
341        {
342            this.setReferences = new java.util.HashSet<Reference>();
343        }
344
345        return this.setReferences;
346    } //-- java.util.Set<Reference> getSetReferences()
347
348    /**
349     * Method getSetStrings.
350     * 
351     * @return Set
352     */
353    public java.util.Set<String> getSetStrings()
354    {
355        if ( this.setStrings == null )
356        {
357            this.setStrings = new java.util.HashSet<String>();
358        }
359
360        return this.setStrings;
361    } //-- java.util.Set<String> getSetStrings()
362
363    /**
364     * Method removeListOfBidi.
365     * 
366     * @param bidiInList
367     */
368    public void removeListOfBidi( BidiInList bidiInList )
369    {
370        bidiInList.breakAssociationFeaturesAssociation( this );
371        getListOfBidis().remove( bidiInList );
372    } //-- void removeListOfBidi( BidiInList )
373
374    /**
375     * Method removeListReference.
376     * 
377     * @param reference
378     */
379    public void removeListReference( Reference reference )
380    {
381        getListReferences().remove( reference );
382    } //-- void removeListReference( Reference )
383
384    /**
385     * Method removeListString.
386     * 
387     * @param string
388     */
389    public void removeListString( String string )
390    {
391        getListStrings().remove( string );
392    } //-- void removeListString( String )
393
394    /**
395     * Method removeSetOfBidi.
396     * 
397     * @param bidiInSet
398     */
399    public void removeSetOfBidi( BidiInSet bidiInSet )
400    {
401        bidiInSet.breakAssociationFeaturesAssociation( this );
402        getSetOfBidis().remove( bidiInSet );
403    } //-- void removeSetOfBidi( BidiInSet )
404
405    /**
406     * Method removeSetReference.
407     * 
408     * @param reference
409     */
410    public void removeSetReference( Reference reference )
411    {
412        getSetReferences().remove( reference );
413    } //-- void removeSetReference( Reference )
414
415    /**
416     * Method removeSetString.
417     * 
418     * @param string
419     */
420    public void removeSetString( String string )
421    {
422        getSetStrings().remove( string );
423    } //-- void removeSetString( String )
424
425    /**
426     * Set the bidi field.
427     * 
428     * @param bidi
429     */
430    public void setBidi( Bidirectional bidi )
431    {
432        if ( this.bidi != null )
433        {
434            this.bidi.breakAssociationFeaturesAssociation( this );
435        }
436
437        this.bidi = bidi;
438
439        if ( bidi != null )
440        {
441            this.bidi.createAssociationFeaturesAssociation( this );
442        }
443    } //-- void setBidi( Bidirectional )
444
445    /**
446     * Set the listOfBidis field.
447     * 
448     * @param listOfBidis
449     */
450    public void setListOfBidis( java.util.List<BidiInList> listOfBidis )
451    {
452        this.listOfBidis = listOfBidis;
453    } //-- void setListOfBidis( java.util.List )
454
455    /**
456     * Set the listReferences field.
457     * 
458     * @param listReferences
459     */
460    public void setListReferences( java.util.List<Reference> listReferences )
461    {
462        this.listReferences = listReferences;
463    } //-- void setListReferences( java.util.List )
464
465    /**
466     * Set the listStrings field.
467     * 
468     * @param listStrings
469     */
470    public void setListStrings( java.util.List<String> listStrings )
471    {
472        this.listStrings = listStrings;
473    } //-- void setListStrings( java.util.List )
474
475    /**
476     * Set the properties field.
477     * 
478     * @param properties
479     */
480    public void setProperties( java.util.Properties properties )
481    {
482        this.properties = properties;
483    } //-- void setProperties( java.util.Properties )
484
485    /**
486     * Set the setOfBidis field.
487     * 
488     * @param setOfBidis
489     */
490    public void setSetOfBidis( java.util.Set<BidiInSet> setOfBidis )
491    {
492        this.setOfBidis = setOfBidis;
493    } //-- void setSetOfBidis( java.util.Set )
494
495    /**
496     * Set the setReferences field.
497     * 
498     * @param setReferences
499     */
500    public void setSetReferences( java.util.Set<Reference> setReferences )
501    {
502        this.setReferences = setReferences;
503    } //-- void setSetReferences( java.util.Set )
504
505    /**
506     * Set the setStrings field.
507     * 
508     * @param setStrings
509     */
510    public void setSetStrings( java.util.Set<String> setStrings )
511    {
512        this.setStrings = setStrings;
513    } //-- void setSetStrings( java.util.Set )
514
515}