IntegerSyntax is an abstract base class providing the common
implementation of all attributes with integer values.
Under the hood, an integer attribute is just an integer. You can get an
integer attribute's integer value by calling getValue().
An integer attribute's integer value is established when it is constructed
(see IntegerSyntax(int)). Once constructed, an
integer attribute's value is immutable.
| Modifier and Type | Field and Description |
|---|---|
| private static final long | serialVersionUID
Use serialVersionUID from JDK 1.4 for interoperability. |
| private int | value
This integer attribute's integer value. |
| Access | Constructor and Description |
|---|---|
| protected | IntegerSyntax(int
Integer value value)Construct a new integer attribute with the given integer value. |
| protected | IntegerSyntax(int
Integer value value, int Lower bound lowerBound, int Upper bound upperBound)Construct a new integer attribute with the given integer value, which must lie within the given range. |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | Returns: true if object is equivalent to this integer
attribute, false otherwiseObject to compare toOverrides java. Returns whether this integer attribute is equivalent to the passed in object. |
| public int | |
| public int | hashCode()
Overrides java. Returns a hash code value for this integer attribute. |
| public String | toString()
Overrides java. Returns a string value corresponding to this integer attribute. |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Use serialVersionUID from JDK 1.4 for interoperability. | |
| value | back to summary |
|---|---|
| private int value This integer attribute's integer value. | |
| IntegerSyntax | back to summary |
|---|---|
| protected IntegerSyntax(int value) Construct a new integer attribute with the given integer value.
| |
| IntegerSyntax | back to summary |
|---|---|
| protected IntegerSyntax(int value, int lowerBound, int upperBound) Construct a new integer attribute with the given integer value, which must lie within the given range.
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object object) Overrides java. Returns whether this integer attribute is equivalent to the passed in object. To be equivalent, all of the following conditions must be true:
| |
| getValue | back to summary |
|---|---|
| public int getValue() Returns this integer attribute's integer value.
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Returns a hash code value for this integer attribute. The hash code is just this integer attribute's integer value.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Returns a string value corresponding to this integer attribute. The string value is just this integer attribute's integer value converted to a string.
| |