Clover icon

jalviewX

  1. Project Clover database Wed Oct 31 2018 15:13:58 GMT
  2. Package jalview.schemabinding.version2.types

File NoValueColour.java

 

Coverage histogram

../../../../img/srcFileCovDistChart7.png
28% of files have more coverage

Code metrics

4
19
7
1
169
62
9
0.47
2.71
7
1.29

Classes

Class Line # Actions
NoValueColour 21 19 9 10
0.666666766.7%
 

Contributing tests

This file is covered by 10 tests. .

Source view

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.schemabinding.version2.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  3 toggle private NoValueColour(final int type, final java.lang.String value)
81    {
82  3 super();
83  3 this.type = type;
84  3 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  0 toggle public static java.util.Enumeration enumerate()
98    {
99  0 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  0 toggle public int getType()
108    {
109  0 return this.type;
110    }
111   
112    /**
113    * Method init.
114    *
115    * @return the initialized Hashtable for the member table
116    */
 
117  1 toggle private static java.util.Hashtable init()
118    {
119  1 Hashtable members = new Hashtable();
120  1 members.put("None", NONE);
121  1 members.put("Min", MIN);
122  1 members.put("Max", MAX);
123  1 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  0 toggle private java.lang.Object readResolve()
133    {
134  0 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  441 toggle public java.lang.String toString()
143    {
144  441 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  3150 toggle public static jalview.schemabinding.version2.types.NoValueColour valueOf(
154    final java.lang.String string)
155    {
156  3150 java.lang.Object obj = null;
157  3150 if (string != null)
158    {
159  3150 obj = _memberTable.get(string);
160    }
161  3150 if (obj == null)
162    {
163  0 String err = "" + string + " is not a valid NoValueColour";
164  0 throw new IllegalArgumentException(err);
165    }
166  3150 return (NoValueColour) obj;
167    }
168   
169    }