Package org.apache.wicket.util.value
Class IntValue
- java.lang.Object
-
- org.apache.wicket.util.value.IntValue
-
- All Implemented Interfaces:
Serializable
,Comparable<IntValue>
public class IntValue extends Object implements Comparable<IntValue>, Serializable
A base class based on the Javaint
primitive for value classes that want to implement standard operations on that value without the pain of aggregating anInteger
object.- Since:
- 1.2.6
- Author:
- Jonathan Locke
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected int
value
theint
value
-
Constructor Summary
Constructors Constructor Description IntValue(int value)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(IntValue that)
boolean
equals(Object that)
Compares thisObject
to a givenObject
.boolean
greaterThan(int value)
Compares thisIntValue
with a primitiveint
value.boolean
greaterThan(IntValue that)
Compares thisIntValue
with anotherIntValue
.int
hashCode()
Returns the hash code for thisObject
.boolean
lessThan(int that)
Compares thisIntValue
with a primitiveint
value.boolean
lessThan(IntValue that)
Compares thisIntValue
with anotherIntValue
.String
toString()
Converts thisLongValue
to aString
.
-
-
-
Field Detail
-
value
protected final int value
theint
value
-
-
Constructor Detail
-
IntValue
public IntValue(int value)
Constructor.- Parameters:
value
- theint
value
-
-
Method Detail
-
compareTo
public final int compareTo(IntValue that)
- Specified by:
compareTo
in interfaceComparable<IntValue>
- Parameters:
that
- The object to compare with- Returns:
- 0 if equal, -1 if less than or 1 if greater than
-
greaterThan
public final boolean greaterThan(int value)
Compares thisIntValue
with a primitiveint
value.- Parameters:
value
- theint
value to compare with- Returns:
true
if thisIntValue
is greater than the givenint
value
-
greaterThan
public final boolean greaterThan(IntValue that)
Compares thisIntValue
with anotherIntValue
.- Parameters:
that
- theIntValue
to compare with- Returns:
true
if thisIntValue
is greater than the givenIntValue
-
hashCode
public final int hashCode()
Returns the hash code for thisObject
.
-
lessThan
public final boolean lessThan(int that)
Compares thisIntValue
with a primitiveint
value.- Parameters:
that
- theint
value to compare with- Returns:
true
if thisIntValue
is less than the givenint
value
-
lessThan
public final boolean lessThan(IntValue that)
Compares thisIntValue
with anotherIntValue
.- Parameters:
that
- theIntValue
to compare with- Returns:
true
if thisIntValue
is less than the givenIntValue
-
-