|
|||||||||||||||||||
| Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
| Enumerator.java | - | 60% | 60% | 60% |
|
||||||||||||||
| 1 | /* $Id: Enumerator.java,v 1.3 2005/06/15 16:11:49 m31 Exp $ | |
| 2 | * | |
| 3 | * This file is part of the project "Hilbert II" - http://www.qedeq.org | |
| 4 | * | |
| 5 | * Copyright 2000-2005, Michael Meyling <mime@qedeq.org>. | |
| 6 | * | |
| 7 | * "Hilbert II" is free software; you can redistribute | |
| 8 | * it and/or modify it under the terms of the GNU General Public | |
| 9 | * License as published by the Free Software Foundation; either | |
| 10 | * version 2 of the License, or (at your option) any later version. | |
| 11 | * | |
| 12 | * This program is distributed in the hope that it will be useful, | |
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 15 | * GNU General Public License for more details. | |
| 16 | */ | |
| 17 | ||
| 18 | package org.qedeq.kernel.dto.elli; | |
| 19 | ||
| 20 | /** | |
| 21 | * An object of this class represents a number, that could be | |
| 22 | * compared and increased. | |
| 23 | * | |
| 24 | * @version $Revision: 1.3 $ | |
| 25 | * @author Michael Meyling | |
| 26 | */ | |
| 27 | public final class Enumerator { | |
| 28 | ||
| 29 | /** The plain number. */ | |
| 30 | private int number; | |
| 31 | ||
| 32 | /** | |
| 33 | * Constructs an object. | |
| 34 | */ | |
| 35 | 0 | public Enumerator() { |
| 36 | 0 | number = 0; |
| 37 | } | |
| 38 | ||
| 39 | /** | |
| 40 | * Constructs an object with given start number. | |
| 41 | * | |
| 42 | * @param number Start value. | |
| 43 | */ | |
| 44 | 76087 | public Enumerator(final int number) { |
| 45 | 76087 | this.number = number; |
| 46 | } | |
| 47 | ||
| 48 | ||
| 49 | /** | |
| 50 | * Gets current number. | |
| 51 | * | |
| 52 | * @return Current number. | |
| 53 | */ | |
| 54 | 113420 | public final int getNumber() { |
| 55 | 113420 | return number; |
| 56 | } | |
| 57 | ||
| 58 | ||
| 59 | /** | |
| 60 | * Increases current number by one. | |
| 61 | */ | |
| 62 | 37333 | public final void increaseNumber() { |
| 63 | 37333 | number++; |
| 64 | } | |
| 65 | ||
| 66 | /** | |
| 67 | * Return number in <code>String</code> format. | |
| 68 | * | |
| 69 | * @return Number as <code>String</code>. | |
| 70 | */ | |
| 71 | 0 | public final String toString() { |
| 72 | 0 | return Integer.toString(number); |
| 73 | } | |
| 74 | ||
| 75 | } |
|
||||||||||