| |
|
| java.lang.Object org.apache.torque.om.ObjectKey org.apache.torque.om.SimpleKey org.apache.torque.om.NumberKey
NumberKey | public class NumberKey extends SimpleKey (Code) | | This class can be used as an ObjectKey to uniquely identify an
object within an application where the id consists
of a single entity such a GUID or the value of a db row's primary key.
author: John McNally author: Stephen Haberman author: Runako Godfrey version: $Id: NumberKey.java 473821 2006-11-11 22:37:25Z tv $ |
Method Summary | |
public byte | byteValue() Returns the value of this NumberKey as a byte. | public int | compareTo(Object o) | public double | doubleValue() Returns the value of this NumberKey as a double. | public boolean | equals(Object keyObj) Two ObjectKeys that both contain null values are not
considered equal. | public float | floatValue() Returns the value of this NumberKey as a float. | public BigDecimal | getBigDecimal() Access the underlying BigDecimal object. | public int | hashCode() | public int | intValue() Returns the value of this NumberKey as an int. | public long | longValue() Returns the value of this NumberKey as a long. | public void | setValue(String key) | public void | setValue(BigDecimal key) | public void | setValue(NumberKey key) Sets the internal representation to the same object used by key. | public short | shortValue() Returns the value of this NumberKey as a short. | public String | toString() Invokes the toString() method on the object. |
NumberKey | public NumberKey()(Code) | | Creates a NumberKey whose internal representation will be
set later, through a set method
|
NumberKey | public NumberKey(String key)(Code) | | Creates a NumberKey equivalent to key .
Parameters: key - the key value |
NumberKey | public NumberKey(BigDecimal key)(Code) | | Creates a NumberKey equivalent to key .
Parameters: key - the key value |
NumberKey | public NumberKey(NumberKey key)(Code) | | Creates a NumberKey equivalent to key .
Parameters: key - the key value |
NumberKey | public NumberKey(long key)(Code) | | Creates a NumberKey equivalent to key .
Parameters: key - the key value |
NumberKey | public NumberKey(double key)(Code) | | Creates a NumberKey equivalent to key .
Parameters: key - the key value |
NumberKey | public NumberKey(int key)(Code) | | Creates a NumberKey equivalent to key .
Convenience only.
Parameters: key - the key value |
NumberKey | public NumberKey(Number key)(Code) | | Creates a NumberKey equivalent to key .
Convenience only.
Parameters: key - the key value |
byteValue | public byte byteValue()(Code) | | Returns the value of this NumberKey as a byte. This value is subject
to the conversion rules set out in
java.math.BigDecimal.byteValue the NumberKey converted to a byte |
compareTo | public int compareTo(Object o)(Code) | | Parameters: o - the comparison value a numeric comparison of the two values |
doubleValue | public double doubleValue()(Code) | | Returns the value of this NumberKey as a double. This value is subject
to the conversion rules set out in
java.math.BigDecimal.doubleValue , most importantly if the
underlying value has too great a magnitude to represent as a
double, it will be converted to Double.NEGATIVE_INFINITY
or Double.POSITIVE_INFINITY as appropriate.
the NumberKey converted to a double |
equals | public boolean equals(Object keyObj)(Code) | | Two ObjectKeys that both contain null values are not
considered equal.
Parameters: keyObj - the key to compare values to whether the two objects are equal |
floatValue | public float floatValue()(Code) | | Returns the value of this NumberKey as a float. This value is subject to
the conversion rules set out in
java.math.BigDecimal.floatValue , most importantly if the
underlying value has too great a magnitude to represent as a
float, it will be converted to Float.NEGATIVE_INFINITY
or Float.POSITIVE_INFINITY as appropriate.
the NumberKey converted to a float |
getBigDecimal | public BigDecimal getBigDecimal()(Code) | | Access the underlying BigDecimal object.
a BigDecimal value |
hashCode | public int hashCode()(Code) | | a hash code based on the value |
intValue | public int intValue()(Code) | | Returns the value of this NumberKey as an int. This value is subject
to the conversion rules set out in
java.math.BigDecimal.intValue , importantly any fractional part
will be discarded and if the underlying value is too big to fit in an
int, only the low-order 32 bits are returned. Note that this
conversion can lose information about the overall magnitude and
precision of the NumberKey value as well as return a result with the
opposite sign.
the NumberKey converted to an int |
longValue | public long longValue()(Code) | | Returns the value of this NumberKey as a long. This value is subject
to the conversion rules set out in
java.math.BigDecimal.intValue the NumberKey converted to a long |
setValue | public void setValue(BigDecimal key)(Code) | | Sets the underlying object
Parameters: key - the key value |
setValue | public void setValue(NumberKey key)(Code) | | Sets the internal representation to the same object used by key.
Parameters: key - the key value |
shortValue | public short shortValue()(Code) | | Returns the value of this NumberKey as a short. This value is subject
to the conversion rules set out in
java.math.BigDecimal.intValue , importantly any fractional part
will be discarded and if the underlying value is too big to fit
in a long, only the low-order 64 bits are returned. Note that this
conversion can lose information about the overall magnitude and
precision of the NumberKey value as well as return a result with the
opposite sign.
the NumberKey converted to a short |
toString | public String toString()(Code) | | Invokes the toString() method on the object. An empty string
is returned is the value is null.
a String representation of the key value |
|
|
|