| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
| AcceptedValue |
|
| 1.0;1 |
| 1 | package us.daveread.utility.formatcheck.format; | |
| 2 | ||
| 3 | /** | |
| 4 | * <p>Title: AcceptedValue | |
| 5 | * <p>Description: Represents a value that will be allowed in a data field | |
| 6 | * <p>Copyright: Copyright (c) 2005 | |
| 7 | * <p>This program is free software; you can redistribute it and/or modify | |
| 8 | * it under the terms of the GNU General Public License as published by | |
| 9 | * the Free Software Foundation; either version 2 of the License, or | |
| 10 | * (at your option) any later version. | |
| 11 | * <p>This program is distributed in the hope that it will be useful, | |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 14 | * GNU General Public License for more details. | |
| 15 | * <p>You should have received a copy of the GNU General Public License | |
| 16 | * along with this program; if not, write to the Free Software | |
| 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
| 18 | * </p> | |
| 19 | * | |
| 20 | * @author David Read | |
| 21 | * @version $Id: AcceptedValue.java,v 1.1.1.1 2006/05/22 02:14:09 daveread Exp $ | |
| 22 | */ | |
| 23 | public class AcceptedValue { | |
| 24 | /** The value to accept */ | |
| 25 | private String value; | |
| 26 | ||
| 27 | /** A description of the value */ | |
| 28 | private String description; | |
| 29 | ||
| 30 | /** | |
| 31 | * Expects the value that will be accepted as well as an optional description. | |
| 32 | * @param aValue String The value allowed in the data field | |
| 33 | * @param aDescription String The optional description for the value, may be null | |
| 34 | */ | |
| 35 | 25 | public AcceptedValue(String aValue, String aDescription) { |
| 36 | 25 | setValue(aValue); |
| 37 | 25 | setDescription(aDescription); |
| 38 | 25 | } |
| 39 | ||
| 40 | /** | |
| 41 | * Set the value | |
| 42 | * @param aValue String The value allowed in the data field | |
| 43 | */ | |
| 44 | private void setValue(String aValue) { | |
| 45 | 25 | value = aValue; |
| 46 | 25 | } |
| 47 | ||
| 48 | /** | |
| 49 | * Gets the value allowed in the data field | |
| 50 | * @return String The value | |
| 51 | */ | |
| 52 | public String getValue() { | |
| 53 | 20 | return value; |
| 54 | } | |
| 55 | ||
| 56 | /** | |
| 57 | * Set the description associated with the value. | |
| 58 | * @param aValue String The description for the value - may be null | |
| 59 | */ | |
| 60 | private void setDescription(String aDescription) { | |
| 61 | 25 | description = aDescription; |
| 62 | 25 | } |
| 63 | ||
| 64 | /** | |
| 65 | * Gets the description associated with the value | |
| 66 | * @return String The description or null if there is no description | |
| 67 | */ | |
| 68 | public String getDescription() { | |
| 69 | 0 | return description; |
| 70 | } | |
| 71 | } |