wicket.util.value
Class IntValue

java.lang.Object
  extended by wicket.util.value.IntValue
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable

public class IntValue
extends java.lang.Object
implements java.lang.Comparable, java.io.Serializable

A base class for value classes based on a Java int primitive which want to implement standard operations on that value without the pain of aggregating a Integer object.

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(java.lang.Object object)
           
 boolean equals(java.lang.Object that)
           
 boolean greaterThan(int value)
           
 boolean greaterThan(IntValue that)
           
 int hashCode()
           
 boolean lessThan(int that)
           
 boolean lessThan(IntValue that)
           
 java.lang.String toString()
          Converts this 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(java.lang.Object object)
Specified by:
compareTo in interface java.lang.Comparable
Parameters:
object - 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)
Overrides:
equals in class java.lang.Object
Parameters:
that - The value to compare against
Returns:
True if this value is equal to that value

greaterThan

public final boolean greaterThan(int value)
Parameters:
value - The value to compare against
Returns:
True if this value is greater than the given value

greaterThan

public final boolean greaterThan(IntValue that)
Parameters:
that - The value to compare against
Returns:
True if this value is greater than that value

hashCode

public final int hashCode()
Overrides:
hashCode in class java.lang.Object
Returns:
Hashcode for this object

lessThan

public final boolean lessThan(int that)
Parameters:
that - The value to compare against
Returns:
True if this value is less than that value

lessThan

public final boolean lessThan(IntValue that)
Parameters:
that - The value to compare against
Returns:
True if this value is less than that value

toString

public java.lang.String toString()
Converts this to a string

Overrides:
toString in class java.lang.Object
Returns:
The string for this int value


Copyright © 2004-2007 Wicket developers. All Rights Reserved.