Clover Coverage Report - FEST Swing 1.2
Coverage timestamp: Tue Jun 1 2010 15:19:25 PDT
../../../../img/srcFileCovDistChart10.png 0% of files have more coverage
14   62   8   2.8
6   28   0.57   5
5     1.6  
1    
 
  Index       Line # 27 14 0% 8 0 100% 1.0
 
No Tests
 
1    /*
2    * Created on Feb 13, 2009
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5    * in compliance with the License. You may obtain a copy of the License at
6    *
7    * http://www.apache.org/licenses/LICENSE-2.0
8    *
9    * Unless required by applicable law or agreed to in writing, software distributed under the License
10    * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
11    * or implied. See the License for the specific language governing permissions and limitations under
12    * the License.
13    *
14    * Copyright @2009-2010 the original author or authors.
15    */
16    package org.fest.swing.data;
17   
18    import static java.lang.String.valueOf;
19    import static org.fest.util.Objects.HASH_CODE_PRIME;
20    import static org.fest.util.Strings.concat;
21   
22    /**
23    * Understands an index.
24    *
25    * @author Alex Ruiz
26    */
 
27    public final class Index {
28   
29    /**
30    * Creates a new <code>{@link Index}</code>.
31    * @param value the value of the index to create.
32    * @return the created index.
33    */
 
34  24 toggle public static Index atIndex(int value) {
35  24 return new Index(value);
36    }
37   
38    /** The value of this index. */
39    public final int value;
40   
 
41  24 toggle private Index(int value) {
42  24 this.value = value;
43    }
44   
 
45  13 toggle @Override public boolean equals(Object obj) {
46  1 if (this == obj) return true;
47  1 if (obj == null) return false;
48  1 if (!(obj instanceof Index)) return false;
49  10 Index other = (Index)obj;
50  10 return value == other.value;
51    }
52   
 
53  2 toggle @Override public int hashCode() {
54  2 int result = 1;
55  2 result = HASH_CODE_PRIME * result + value;
56  2 return result;
57    }
58   
 
59  1 toggle @Override public String toString() {
60  1 return concat(getClass().getName(), "[value=", valueOf(value), "]");
61    }
62    }