Clover Coverage Report
Coverage timestamp: Fri May 24 2013 13:47:27 UTC
../../../../img/srcFileCovDistChart10.png 0% of files have more coverage
10   88   10   1.25
2   31   1   8
8     1.25  
1    
 
  Enumerator       Line # 24 10 10 100% 1.0
 
  (371)
 
1    /* This file is part of the project "Hilbert II" - http://www.qedeq.org
2    *
3    * Copyright 2000-2013, Michael Meyling <mime@qedeq.org>.
4    *
5    * "Hilbert II" is free software; you can redistribute
6    * it and/or modify it under the terms of the GNU General Public
7    * License as published by the Free Software Foundation; either
8    * version 2 of the License, or (at your option) any later version.
9    *
10    * This program is distributed in the hope that it will be useful,
11    * but WITHOUT ANY WARRANTY; without even the implied warranty of
12    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13    * GNU General Public License for more details.
14    */
15   
16    package org.qedeq.base.utility;
17   
18    /**
19    * An object of this class represents a number, that could be
20    * compared and increased.
21    *
22    * @author Michael Meyling
23    */
 
24    public final class Enumerator {
25   
26    /** The plain number. */
27    private int number;
28   
29    /**
30    * Constructs an object with 0 as start number.
31    */
 
32  250174 toggle public Enumerator() {
33  250174 number = 0;
34    }
35   
36    /**
37    * Constructs an object with given start number.
38    *
39    * @param number Start value.
40    */
 
41  138309392 toggle public Enumerator(final int number) {
42  138309392 this.number = number;
43    }
44   
45    /**
46    * Gets current number.
47    *
48    * @return Current number.
49    */
 
50  216465178 toggle public final int getNumber() {
51  216465178 return number;
52    }
53   
54    /**
55    * Reset counter to zero.
56    */
 
57  8827 toggle public final void reset() {
58  8827 number = 0;
59    }
60   
61    /**
62    * Increases current number by one.
63    */
 
64  77249696 toggle public final void increaseNumber() {
65  77249696 number++;
66    }
67   
 
68  10 toggle public final boolean equals(final Object object) {
69  10 if (object == null || !(object instanceof Enumerator)) {
70  2 return false;
71    }
72  8 return getNumber() == ((Enumerator) object).getNumber();
73    }
74   
 
75  110 toggle public final int hashCode() {
76  110 return number;
77    }
78   
79    /**
80    * Return number in <code>String</code> format.
81    *
82    * @return Number as <code>String</code>.
83    */
 
84  2 toggle public final String toString() {
85  2 return Integer.toString(number);
86    }
87   
88    }