Clover icon

jalviewX

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

File FeatureMatcherByType.java

 

Coverage histogram

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

Code metrics

4
19
7
1
168
54
9
0.47
2.71
7
1.29

Classes

Class Line # Actions
FeatureMatcherByType 21 19 9 10
0.666666766.7%
 

Contributing tests

This file is covered by 2 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    * Class FeatureMatcherByType.
18    *
19    * @version $Revision$ $Date$
20    */
 
21    public class FeatureMatcherByType implements java.io.Serializable {
22   
23   
24    //--------------------------/
25    //- Class/Member Variables -/
26    //--------------------------/
27   
28    /**
29    * The byLabel type
30    */
31    public static final int BYLABEL_TYPE = 0;
32   
33    /**
34    * The instance of the byLabel type
35    */
36    public static final FeatureMatcherByType BYLABEL = new FeatureMatcherByType(BYLABEL_TYPE, "byLabel");
37   
38    /**
39    * The byScore type
40    */
41    public static final int BYSCORE_TYPE = 1;
42   
43    /**
44    * The instance of the byScore type
45    */
46    public static final FeatureMatcherByType BYSCORE = new FeatureMatcherByType(BYSCORE_TYPE, "byScore");
47   
48    /**
49    * The byAttribute type
50    */
51    public static final int BYATTRIBUTE_TYPE = 2;
52   
53    /**
54    * The instance of the byAttribute type
55    */
56    public static final FeatureMatcherByType BYATTRIBUTE = new FeatureMatcherByType(BYATTRIBUTE_TYPE, "byAttribute");
57   
58    /**
59    * Field _memberTable.
60    */
61    private static java.util.Hashtable _memberTable = init();
62   
63    /**
64    * Field type.
65    */
66    private int type = -1;
67   
68    /**
69    * Field stringValue.
70    */
71    private java.lang.String stringValue = null;
72   
73   
74    //----------------/
75    //- Constructors -/
76    //----------------/
77   
 
78  3 toggle private FeatureMatcherByType(final int type, final java.lang.String value) {
79  3 super();
80  3 this.type = type;
81  3 this.stringValue = value;
82    }
83   
84   
85    //-----------/
86    //- Methods -/
87    //-----------/
88   
89    /**
90    * Method enumerate.Returns an enumeration of all possible
91    * instances of FeatureMatcherByType
92    *
93    * @return an Enumeration over all possible instances of
94    * FeatureMatcherByType
95    */
 
96  0 toggle public static java.util.Enumeration enumerate(
97    ) {
98  0 return _memberTable.elements();
99    }
100   
101    /**
102    * Method getType.Returns the type of this FeatureMatcherByType
103    *
104    * @return the type of this FeatureMatcherByType
105    */
 
106  0 toggle public int getType(
107    ) {
108  0 return this.type;
109    }
110   
111    /**
112    * Method init.
113    *
114    * @return the initialized Hashtable for the member table
115    */
 
116  1 toggle private static java.util.Hashtable init(
117    ) {
118  1 Hashtable members = new Hashtable();
119  1 members.put("byLabel", BYLABEL);
120  1 members.put("byScore", BYSCORE);
121  1 members.put("byAttribute", BYATTRIBUTE);
122  1 return members;
123    }
124   
125    /**
126    * Method readResolve. will be called during deserialization to
127    * replace the deserialized object with the correct constant
128    * 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
139    * FeatureMatcherByType
140    *
141    * @return the String representation of this FeatureMatcherByTyp
142    */
 
143  25 toggle public java.lang.String toString(
144    ) {
145  25 return this.stringValue;
146    }
147   
148    /**
149    * Method valueOf.Returns a new FeatureMatcherByType based on
150    * the given String value.
151    *
152    * @param string
153    * @return the FeatureMatcherByType value of parameter 'string'
154    */
 
155  10 toggle public static jalview.schemabinding.version2.types.FeatureMatcherByType valueOf(
156    final java.lang.String string) {
157  10 java.lang.Object obj = null;
158  10 if (string != null) {
159  10 obj = _memberTable.get(string);
160    }
161  10 if (obj == null) {
162  0 String err = "" + string + " is not a valid FeatureMatcherByType";
163  0 throw new IllegalArgumentException(err);
164    }
165  10 return (FeatureMatcherByType) obj;
166    }
167   
168    }