org.apache.wicket.util.value
Class LongValue

java.lang.Object
  extended by org.apache.wicket.util.value.LongValue
All Implemented Interfaces:
Serializable, Comparable<LongValue>
Direct Known Subclasses:
Bytes, Duration, Time, TimeOfDay

public class LongValue
extends Object
implements Comparable<LongValue>, Serializable

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

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

Field Summary
protected  long value
          the long value
 
Constructor Summary
LongValue(long value)
          Constructor.
 
Method Summary
 int compareTo(LongValue that)
          Compares this Object to a given Object.
 boolean equals(Object that)
          Tests for equality.
 boolean greaterThan(long value)
          Compares this LongValue with a primitive long value.
 boolean greaterThan(LongValue that)
          Compares this LongValue with another LongValue.
 int hashCode()
          Returns the hash code for this Object.
 boolean lessThan(long that)
          Compares this LongValue with a primitive long value.
 boolean lessThan(LongValue that)
          Compares this LongValue with another LongValue.
 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 long value
the long value

Constructor Detail

LongValue

public LongValue(long value)
Constructor.

Parameters:
value - the long value
Method Detail

compareTo

public final int compareTo(LongValue that)
Compares this Object to a given Object.

Specified by:
compareTo in interface Comparable<LongValue>
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

equals

public final boolean equals(Object that)
Tests for equality.

Overrides:
equals in class Object
Parameters:
that - the Object to compare with
Returns:
true if this Object's value is equal to the given Object's value

greaterThan

public final boolean greaterThan(long value)
Compares this LongValue with a primitive long value.

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

greaterThan

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

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

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(long that)
Compares this LongValue with a primitive long value.

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

lessThan

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

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

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.