org.apache.wicket.util.value
Class IntValue

java.lang.Object
  extended by 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 Java int primitive for value classes that want to implement standard operations on that value without the pain of aggregating an Integer object.

Since:
1.2.6
Author:
Jonathan Locke
See Also:
Serialized Form

Field Summary
protected  int value
          the int value
 
Constructor Summary
IntValue(int value)
          Constructor.
 
Method Summary
 int compareTo(IntValue that)
           
 boolean equals(Object that)
          Compares this Object to a given Object.
 boolean greaterThan(int value)
          Compares this IntValue with a primitive int value.
 boolean greaterThan(IntValue that)
          Compares this IntValue with another IntValue.
 int hashCode()
          Returns the hash code for this Object.
 boolean lessThan(int that)
          Compares this IntValue with a primitive int value.
 boolean lessThan(IntValue that)
          Compares this IntValue with another IntValue.
 String toString()
          Converts this LongValue to a String.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

value

protected final int value
the int value

Constructor Detail

IntValue

public IntValue(int value)
Constructor.

Parameters:
value - the int value
Method Detail

compareTo

public final int compareTo(IntValue that)
Specified by:
compareTo in interface 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(Object that)
Compares this Object to a given Object.

Overrides:
equals in class Object
Parameters:
that - the Object to compare with
Returns:
0 if equal, -1 if less than the given Object's value, or 1 if greater than given Object's value

greaterThan

public final boolean greaterThan(int value)
Compares this IntValue with a primitive int value.

Parameters:
value - the int value to compare with
Returns:
true if this IntValue is greater than the given int value

greaterThan

public final boolean greaterThan(IntValue that)
Compares this IntValue with another IntValue.

Parameters:
that - the IntValue to compare with
Returns:
true if this IntValue is greater than the given IntValue

hashCode

public final int hashCode()
Returns the hash code for this Object.

Overrides:
hashCode in class Object
Returns:
hash code for this Object

lessThan

public final boolean lessThan(int that)
Compares this IntValue with a primitive int value.

Parameters:
that - the int value to compare with
Returns:
true if this IntValue is less than the given int value

lessThan

public final boolean lessThan(IntValue that)
Compares this IntValue with another IntValue.

Parameters:
that - the IntValue to compare with
Returns:
true if this IntValue is less than the given IntValue

toString

public String toString()
Converts this LongValue to a String.

Overrides:
toString in class Object
Returns:
a String representation of this LongValue


Copyright © 2004-2011 Apache Software Foundation. All Rights Reserved.