X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fschemabinding%2Fversion2%2Ftypes%2FNoValueColour.java;fp=src%2Fjalview%2Fschemabinding%2Fversion2%2Ftypes%2FNoValueColour.java;h=bbef3d78bda341113388fc1f529e3b1f5f999058;hb=14b1b2a878190d5fffda298c4b9a901c72c74ad3;hp=0000000000000000000000000000000000000000;hpb=4073e96c3cb60f28c01cd91ec7f847cafbf01f78;p=jalview.git diff --git a/src/jalview/schemabinding/version2/types/NoValueColour.java b/src/jalview/schemabinding/version2/types/NoValueColour.java new file mode 100644 index 0000000..bbef3d7 --- /dev/null +++ b/src/jalview/schemabinding/version2/types/NoValueColour.java @@ -0,0 +1,169 @@ +/* + * This class was automatically generated with + * Castor 1.1, using an XML + * Schema. + * $Id$ + */ + +package jalview.schemabinding.version2.types; + +//---------------------------------/ +//- Imported classes and packages -/ +//---------------------------------/ + +import java.util.Hashtable; + +/** + * Graduated feature colour if no score (or attribute) value + * + * @version $Revision$ $Date$ + */ +public class NoValueColour implements java.io.Serializable +{ + + // --------------------------/ + // - Class/Member Variables -/ + // --------------------------/ + + /** + * The None type + */ + public static final int NONE_TYPE = 0; + + /** + * The instance of the None type + */ + public static final NoValueColour NONE = new NoValueColour(NONE_TYPE, + "None"); + + /** + * The Min type + */ + public static final int MIN_TYPE = 1; + + /** + * The instance of the Min type + */ + public static final NoValueColour MIN = new NoValueColour(MIN_TYPE, + "Min"); + + /** + * The Max type + */ + public static final int MAX_TYPE = 2; + + /** + * The instance of the Max type + */ + public static final NoValueColour MAX = new NoValueColour(MAX_TYPE, + "Max"); + + /** + * Field _memberTable. + */ + private static java.util.Hashtable _memberTable = init(); + + /** + * Field type. + */ + private int type = -1; + + /** + * Field stringValue. + */ + private java.lang.String stringValue = null; + + // ----------------/ + // - Constructors -/ + // ----------------/ + + private NoValueColour(final int type, final java.lang.String value) + { + super(); + this.type = type; + this.stringValue = value; + } + + // -----------/ + // - Methods -/ + // -----------/ + + /** + * Method enumerate.Returns an enumeration of all possible instances of + * NoValueColour + * + * @return an Enumeration over all possible instances of NoValueColour + */ + public static java.util.Enumeration enumerate() + { + return _memberTable.elements(); + } + + /** + * Method getType.Returns the type of this NoValueColour + * + * @return the type of this NoValueColour + */ + public int getType() + { + return this.type; + } + + /** + * Method init. + * + * @return the initialized Hashtable for the member table + */ + private static java.util.Hashtable init() + { + Hashtable members = new Hashtable(); + members.put("None", NONE); + members.put("Min", MIN); + members.put("Max", MAX); + return members; + } + + /** + * Method readResolve. will be called during deserialization to replace the + * deserialized object with the correct constant instance. + * + * @return this deserialized object + */ + private java.lang.Object readResolve() + { + return valueOf(this.stringValue); + } + + /** + * Method toString.Returns the String representation of this NoValueColour + * + * @return the String representation of this NoValueColour + */ + public java.lang.String toString() + { + return this.stringValue; + } + + /** + * Method valueOf.Returns a new NoValueColour based on the given String value. + * + * @param string + * @return the NoValueColour value of parameter 'string' + */ + public static jalview.schemabinding.version2.types.NoValueColour valueOf( + final java.lang.String string) + { + java.lang.Object obj = null; + if (string != null) + { + obj = _memberTable.get(string); + } + if (obj == null) + { + String err = "" + string + " is not a valid NoValueColour"; + throw new IllegalArgumentException(err); + } + return (NoValueColour) obj; + } + +}