View Javadoc

1   // Copyright 2006-2007, by the California Institute of Technology.
2   // ALL RIGHTS RESERVED. United States Government Sponsorship acknowledged.
3   // Any commercial use must be negotiated with the Office of Technology Transfer
4   // at the California Institute of Technology.
5   //
6   // This software is subject to U. S. export control laws and regulations
7   // (22 C.F.R. 120-130 and 15 C.F.R. 730-774). To the extent that the software
8   // is subject to U.S. export control laws and regulations, the recipient has
9   // the responsibility to obtain export licenses or other export authority as
10  // may be required before exporting such information to foreign countries or
11  // providing access to foreign nationals.
12  //
13  // $Id: Definition.java 2942 2007-09-27 20:22:04Z pramirez $ 
14  //
15  
16  package gov.nasa.pds.tools.dict;
17  
18  import java.util.Iterator;
19  import java.util.List;
20  import java.util.ArrayList;
21  
22  /***
23   * @author pramirez
24   * @version $Revision: 2942 $
25   * 
26   */
27  public abstract class Definition {
28      private String identifier;
29      private String statusType;
30      private String description;
31      private List aliases;
32      protected String objectType;
33      
34      public Definition(String identifier) {
35          this.identifier = identifier;
36          description = "";
37          statusType = "PROPOSED";
38          objectType = null;
39          aliases = new ArrayList();
40      }
41  
42      /***
43       * The aliases for this definition
44       * @return Returns the aliases.
45       */
46      public List getAliases() {
47          return aliases;
48      }
49      
50      /***
51       * Add an alias for this Definition
52       * @param alias The alias to add
53       */
54      public void addAlias(Alias alias) {
55          if (!aliases.contains(alias) && !identifier.equals(alias.getIdentifier()))
56              aliases.add(alias);
57      }
58  
59      /***
60       * @param aliases The aliases to set.
61       */
62      public void setAliases(List aliases) {
63          this.aliases = aliases;
64      }
65      
66      public void addAliases(List aliases) {
67          this.aliases.addAll(aliases);
68      }
69  
70      /***
71       * @return Returns the identifier.
72       */
73      public String getIdentifier() {
74          return identifier;
75      }
76  
77      /***
78       * @return Returns the description.
79       */
80      public String getDescription() {
81          return description;
82      }
83  
84      /***
85       * @param description The description to set.
86       */
87      public void setDescription(String description) {
88          this.description = description;
89      }
90  
91      /***
92       * @return Returns the statusType.
93       */
94      public String getStatusType() {
95          return statusType;
96      }
97  
98      /***
99       * @param statusType The statusType to set.
100      */
101     public void setStatusType(String statusType) {
102         this.statusType = statusType;
103     }
104 
105     /***
106      * @param identifier The identifier to set.
107      */
108     public void setIdentifier(String identifier) {
109         this.identifier = identifier;
110     }
111     
112     public void setObjectType(String objectType) {
113         this.objectType = objectType;
114     }
115     
116     public String getObjectType() {
117         return objectType;
118     }
119 
120 }