KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > nightlabs > ipanema > config > FeatureSetConfigModule


1 /**
2  * Created Jul 8, 2005, 9:21:22 PM by nick
3  */

4 package com.nightlabs.ipanema.config;
5
6 import java.io.Serializable JavaDoc;
7 import java.util.Collection JavaDoc;
8 import java.util.HashSet JavaDoc;
9
10 import javax.jdo.Extent;
11 import javax.jdo.PersistenceManager;
12 import javax.jdo.Query;
13
14 import com.nightlabs.ipanema.workstation.Workstation;
15
16 /**
17  * @author Niklas Schiffler <nick@nightlabs.de>
18  *
19  *
20  * @jdo.persistence-capable
21  * identity-type = "application"
22  * detachable = "true"
23  * persistence-cabable-superclass = "com.nightlabs.ipanema.config.ConfigModule"
24  *
25  * @jdo.inheritance strategy = "new-table"
26  */

27 public class FeatureSetConfigModule extends ConfigModule implements Serializable JavaDoc
28 {
29   /**
30    * @jdo.field persistence-modifier="persistent"
31    */

32   protected WorkstationConfig workstationConfig;
33   
34   /**
35    * @jdo.field persistence-modifier="persistent"
36    */

37   private Collection JavaDoc featureIDs;
38   
39   public FeatureSetConfigModule(WorkstationConfig wsConfig, String JavaDoc cfModID)
40   {
41     super(wsConfig.getOrganisationID(), wsConfig.getConfigID(), FeatureSetConfigModule.class.getName(), cfModID);
42     this.workstationConfig = wsConfig;
43   }
44   
45   public void init()
46   {
47     if(featureIDs == null)
48       featureIDs = new HashSet JavaDoc();
49   }
50  
51   public Collection JavaDoc getFeatureIDs()
52   {
53     return featureIDs;
54   }
55   
56   public void addfeatureID(String JavaDoc featureID)
57   {
58     if(!featureIDs.contains(featureID))
59       featureIDs.add(featureID);
60   }
61   
62   public void removeFeatureID(String JavaDoc featureID)
63   {
64     if(featureIDs.contains(featureID))
65       featureIDs.remove(featureID);
66   }
67   
68   
69 }
70
Popular Tags