Merge branch 'feature/JAL-3063JAXB' into feature/JAL-3063jaxbNoCastor
[jalview.git] / src / jalview / binding / types / NoValueColour.java
1 /*
2  * This class was automatically generated with 
3  * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
4  * Schema.
5  * $Id$
6  */
7
8 package jalview.binding.types;
9
10 //---------------------------------/
11 //- Imported classes and packages -/
12 //---------------------------------/
13
14 import java.util.Hashtable;
15
16 /**
17  * Graduated feature colour if no score (or attribute) value
18  * 
19  * @version $Revision$ $Date$
20  */
21 public class NoValueColour implements java.io.Serializable
22 {
23
24   // --------------------------/
25   // - Class/Member Variables -/
26   // --------------------------/
27
28   /**
29    * The None type
30    */
31   public static final int NONE_TYPE = 0;
32
33   /**
34    * The instance of the None type
35    */
36   public static final NoValueColour NONE = new NoValueColour(NONE_TYPE,
37           "None");
38
39   /**
40    * The Min type
41    */
42   public static final int MIN_TYPE = 1;
43
44   /**
45    * The instance of the Min type
46    */
47   public static final NoValueColour MIN = new NoValueColour(MIN_TYPE,
48           "Min");
49
50   /**
51    * The Max type
52    */
53   public static final int MAX_TYPE = 2;
54
55   /**
56    * The instance of the Max type
57    */
58   public static final NoValueColour MAX = new NoValueColour(MAX_TYPE,
59           "Max");
60
61   /**
62    * Field _memberTable.
63    */
64   private static java.util.Hashtable _memberTable = init();
65
66   /**
67    * Field type.
68    */
69   private int type = -1;
70
71   /**
72    * Field stringValue.
73    */
74   private java.lang.String stringValue = null;
75
76   // ----------------/
77   // - Constructors -/
78   // ----------------/
79
80   private NoValueColour(final int type, final java.lang.String value)
81   {
82     super();
83     this.type = type;
84     this.stringValue = value;
85   }
86
87   // -----------/
88   // - Methods -/
89   // -----------/
90
91   /**
92    * Method enumerate.Returns an enumeration of all possible instances of
93    * NoValueColour
94    * 
95    * @return an Enumeration over all possible instances of NoValueColour
96    */
97   public static java.util.Enumeration enumerate()
98   {
99     return _memberTable.elements();
100   }
101
102   /**
103    * Method getType.Returns the type of this NoValueColour
104    * 
105    * @return the type of this NoValueColour
106    */
107   public int getType()
108   {
109     return this.type;
110   }
111
112   /**
113    * Method init.
114    * 
115    * @return the initialized Hashtable for the member table
116    */
117   private static java.util.Hashtable init()
118   {
119     Hashtable members = new Hashtable();
120     members.put("None", NONE);
121     members.put("Min", MIN);
122     members.put("Max", MAX);
123     return members;
124   }
125
126   /**
127    * Method readResolve. will be called during deserialization to replace the
128    * deserialized object with the correct constant instance.
129    * 
130    * @return this deserialized object
131    */
132   private java.lang.Object readResolve()
133   {
134     return valueOf(this.stringValue);
135   }
136
137   /**
138    * Method toString.Returns the String representation of this NoValueColour
139    * 
140    * @return the String representation of this NoValueColour
141    */
142   public java.lang.String toString()
143   {
144     return this.stringValue;
145   }
146
147   /**
148    * Method valueOf.Returns a new NoValueColour based on the given String value.
149    * 
150    * @param string
151    * @return the NoValueColour value of parameter 'string'
152    */
153   public static jalview.binding.types.NoValueColour valueOf(
154           final java.lang.String string)
155   {
156     java.lang.Object obj = null;
157     if (string != null)
158     {
159       obj = _memberTable.get(string);
160     }
161     if (obj == null)
162     {
163       String err = "" + string + " is not a valid NoValueColour";
164       throw new IllegalArgumentException(err);
165     }
166     return (NoValueColour) obj;
167   }
168
169 }