public class IntConstant
extends java.lang.Object
For an example on the correct usage of this pattern, see the Padding.ID class.
| Modifier and Type | Field and Description |
|---|---|
protected java.lang.String |
description
String description of this instance.
|
protected int |
value
Value that this instance holds.
|
| Constructor and Description |
|---|
IntConstant(int value)
Constructor that takes an int and sets it as the internally held value.
|
IntConstant(int value, java.lang.String description)
Constructor that takes an int and sets it as the internally held value, as well as a description.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getDescription()
Returns the string description of this
IntConstant, or null if none is set. |
int |
getValue()
Returns the internally held int value.
|
java.lang.String |
toString()
Returns a string representation of this object, of the form "description(value)".
|
protected final int value
protected final java.lang.String description
public IntConstant(int value)
public IntConstant(int value,
java.lang.String description)
public int getValue()
public java.lang.String getDescription()
IntConstant, or null if none is set.public java.lang.String toString()
toString in class java.lang.Object