View Javadoc

1   package net.sf.tomp.xml.type;
2   
3   /***
4    * DOCUMENT ME!
5    * 
6    * @author $author$
7    * @version $Revision$
8    */
9   public class VariantImpl implements Variant {
10      /*** DOCUMENT ME! */
11      protected String id;
12  
13      /***
14       * Creates a new VariantImpl object.
15       * 
16       * @param v DOCUMENT ME!
17       */
18      public VariantImpl(String v) {
19          if ((v == null) || (v.length() == 0)) {
20              v = "NO_VARIANT";
21          }
22  
23          id = v;
24      }
25  
26      /***
27       * DOCUMENT ME!
28       * 
29       * @return DOCUMENT ME!
30       */
31      public String getId() {
32          return id;
33      }
34  
35      /***
36       * DOCUMENT ME!
37       * 
38       * @return DOCUMENT ME!
39       */
40      public String toString() {
41          return "VariantImpl[" + id + "]";
42      }
43  
44      /***
45       * DOCUMENT ME!
46       * 
47       * @param o DOCUMENT ME!
48       * @return DOCUMENT ME!
49       */
50      public boolean equals(Object o) {
51          Variant v = (Variant) o;
52  
53          return id.equals(v.getId());
54      }
55  
56      /***
57       * DOCUMENT ME!
58       * 
59       * @return DOCUMENT ME!
60       */
61      public int hashCode() {
62          return id.hashCode();
63      }
64  }
65  
66  /*
67   * The contents of this file are subject to the Mozilla Public License Version
68   * 1.1 (the "License"); you may not use this file except in compliance with the
69   * License. You may obtain a copy of the License at http://www.mozilla.org/MPL/
70   * Software distributed under the License is distributed on an "AS IS" basis,
71   * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
72   * the specific language governing rights and limitations under the License. The
73   * Original Code is: all this file. The Initial Developer of the Original Code
74   * is: Tomas Pitner, Masaryk University in Brno, Czech Republic. Contributor(s):
75   */