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 2601 2007-04-12 18:34:25Z 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: 2601 $
25   * 
26   */
27  public abstract class Definition {
28      private String identifier;
29      private String statusType;
30      private String description;
31      private List aliases;
32      
33      public Definition(String identifier) {
34          this.identifier = identifier;
35          description = "";
36          statusType = "";
37          aliases = new ArrayList();
38      }
39  
40      /***
41       * The aliases for this definition
42       * @return Returns the aliases.
43       */
44      public List getAliases() {
45          return aliases;
46      }
47      
48      /***
49       * Add an alias for this Definition
50       * @param alias The alias to add
51       */
52      public void addAlias(String alias) {
53          if (!aliases.contains(alias) && !identifier.equals(alias))
54              aliases.add(alias);
55      }
56  
57      /***
58       * @param aliases The aliases to set.
59       */
60      public void setAliases(List aliases) {
61          this.aliases = aliases;
62      }
63      
64      public void addAliases(List aliases) {
65          for (Iterator i = aliases.iterator(); i.hasNext();) {
66              String alias = i.next().toString();
67              if (!this.aliases.contains(alias) && !identifier.equals(alias))
68                  this.aliases.add(alias);
69          }
70      }
71  
72      /***
73       * @return Returns the identifier.
74       */
75      public String getIdentifier() {
76          return identifier;
77      }
78  
79      /***
80       * @return Returns the description.
81       */
82      public String getDescription() {
83          return description;
84      }
85  
86      /***
87       * @param description The description to set.
88       */
89      public void setDescription(String description) {
90          this.description = description;
91      }
92  
93      /***
94       * @return Returns the statusType.
95       */
96      public String getStatusType() {
97          return statusType;
98      }
99  
100     /***
101      * @param statusType The statusType to set.
102      */
103     public void setStatusType(String statusType) {
104         this.statusType = statusType;
105     }
106 
107     /***
108      * @param identifier The identifier to set.
109      */
110     public void setIdentifier(String identifier) {
111         this.identifier = identifier;
112     }
113 
114 }