Package org.apache.wicket.util.value
Class IntValue
- java.lang.Object
-
- org.apache.wicket.util.value.IntValue
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<IntValue>
public class IntValue extends java.lang.Object implements java.lang.Comparable<IntValue>, java.io.Serializable
A base class based on the Javaintprimitive for value classes that want to implement standard operations on that value without the pain of aggregating anIntegerobject.- Since:
- 1.2.6
- Author:
- Jonathan Locke
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected intvaluetheintvalue
-
Constructor Summary
Constructors Constructor Description IntValue(int value)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(IntValue that)booleanequals(java.lang.Object that)Compares thisObjectto a givenObject.booleangreaterThan(int value)Compares thisIntValuewith a primitiveintvalue.booleangreaterThan(IntValue that)Compares thisIntValuewith anotherIntValue.inthashCode()Returns the hash code for thisObject.booleanlessThan(int that)Compares thisIntValuewith a primitiveintvalue.booleanlessThan(IntValue that)Compares thisIntValuewith anotherIntValue.java.lang.StringtoString()Converts thisLongValueto aString.
-
-
-
Method Detail
-
compareTo
public final int compareTo(IntValue that)
- Specified by:
compareToin interfacejava.lang.Comparable<IntValue>- Parameters:
that- The object to compare with- Returns:
- 0 if equal, -1 if less than or 1 if greater than
-
equals
public final boolean equals(java.lang.Object that)
Compares thisObjectto a givenObject.- Overrides:
equalsin classjava.lang.Object- Parameters:
that- theObjectto compare with- Returns:
- 0 if equal, -1 if less than the given
Object's value, or 1 if greater than givenObject's value
-
greaterThan
public final boolean greaterThan(int value)
Compares thisIntValuewith a primitiveintvalue.- Parameters:
value- theintvalue to compare with- Returns:
trueif thisIntValueis greater than the givenintvalue
-
greaterThan
public final boolean greaterThan(IntValue that)
Compares thisIntValuewith anotherIntValue.- Parameters:
that- theIntValueto compare with- Returns:
trueif thisIntValueis greater than the givenIntValue
-
hashCode
public final int hashCode()
Returns the hash code for thisObject.- Overrides:
hashCodein classjava.lang.Object- Returns:
- hash code for this
Object
-
lessThan
public final boolean lessThan(int that)
Compares thisIntValuewith a primitiveintvalue.- Parameters:
that- theintvalue to compare with- Returns:
trueif thisIntValueis less than the givenintvalue
-
lessThan
public final boolean lessThan(IntValue that)
Compares thisIntValuewith anotherIntValue.- Parameters:
that- theIntValueto compare with- Returns:
trueif thisIntValueis less than the givenIntValue
-
toString
public java.lang.String toString()
Converts thisLongValueto aString.- Overrides:
toStringin classjava.lang.Object- Returns:
- a
Stringrepresentation of thisLongValue
-
-