EAF 7.4 API

com.lutris.appserver.server.sql
Class ObjectId

java.lang.Object
  extended by com.lutris.appserver.server.sql.ObjectId
All Implemented Interfaces:
java.io.Serializable

public class ObjectId
extends java.lang.Object
implements java.io.Serializable

Represents an object id used by LBS data objects. The object id must be unique. The combination of database URL and object id constitutes a GUID. The maximum value of an object id is DECIMAL(19,0)

Since:
LBS1.7
Version:
$Revision: 1.1 $
Author:
Kyle Clark
See Also:
ObjectIdAllocator, Serialized Form

Field Summary
static java.math.BigDecimal MAX
          The maximum value that can be associated with an object id in LBS - DECIMAL(19,0).
static java.math.BigDecimal ONE
          The value of one.
 
Constructor Summary
ObjectId(java.math.BigDecimal val)
          Creates and object id whose value is the same as val.
ObjectId(long val)
          Translates a long into an ObjectID.
ObjectId(java.lang.String val)
          Translates a string containing one or more decimal digits into an ObjectID.
ObjectId(java.lang.String val, int radix)
          Translates a string containing one or more integers of the specified radix into an ObjectID.
 
Method Summary
 ObjectId add(long val)
          Returns an object id whose value is (this+val).
 ObjectId add(ObjectId val)
          Returns an object id whose value is (this+val).
 boolean equals(ObjectId oid)
          Test if this object id is equal to another object id.
 int hashCode()
          Returns a hash code for this object id.
 ObjectId increment()
          Returns an object id whose value is (this+1)
 java.math.BigDecimal toBigDecimal()
          Returns a big decimal representation of the object id.
 java.lang.String toString()
          String representation of this object id.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ONE

public static final java.math.BigDecimal ONE
The value of one.


MAX

public static final java.math.BigDecimal MAX
The maximum value that can be associated with an object id in LBS - DECIMAL(19,0).

Constructor Detail

ObjectId

public ObjectId(java.lang.String val,
                int radix)
         throws ObjectIdException,
                java.lang.NumberFormatException
Translates a string containing one or more integers of the specified radix into an ObjectID. The string may not represet a negative number.

Parameters:
val - The string representation of the number. The character to digit mapping is provided by Character.digit()
radix - Must be between Character.MIN_RADIX(2) and Character.MAX_RADIX(36).
Throws:
java.lang.NumberFormatException - If the string representation contains invalid characters.
ObjectIdException - If val represents a negative number.

ObjectId

public ObjectId(java.lang.String val)
         throws ObjectIdException,
                java.lang.NumberFormatException
Translates a string containing one or more decimal digits into an ObjectID.

Parameters:
val - The string representation of the decimal number that The character to digit mapping is provided by Character.digit()
Throws:
java.lang.NumberFormatException - If the string representation contains invalid characters.
ObjectIdException - If val represents a negative number.

ObjectId

public ObjectId(long val)
         throws ObjectIdException
Translates a long into an ObjectID.

Parameters:
val - The value to assign to the object id.
Throws:
ObjectIdException - If val is a negative number.

ObjectId

public ObjectId(java.math.BigDecimal val)
         throws ObjectIdException
Creates and object id whose value is the same as val.

Parameters:
val - The value to assign to the object id.
Throws:
ObjectIdException - If val is a negative number or the scale of val is greater than zero.
Method Detail

add

public ObjectId add(ObjectId val)
             throws ObjectIdException
Returns an object id whose value is (this+val).

Parameters:
val - The value to add to this object.
Throws:
ObjectIdException - If the result of the addition would result in an object id that exceeds the maximum object id size.

add

public ObjectId add(long val)
             throws ObjectIdException
Returns an object id whose value is (this+val).

Parameters:
val - The value to add to this object.
Throws:
ObjectIdException - If the result of the addition would result in an object id that exceeds the maximum object id size.

increment

public ObjectId increment()
                   throws ObjectIdException
Returns an object id whose value is (this+1)

Throws:
ObjectIdException - If the result of the addition would result in an object id that exceeds the maximum object id size.

toBigDecimal

public java.math.BigDecimal toBigDecimal()
Returns a big decimal representation of the object id.


equals

public boolean equals(ObjectId oid)
Test if this object id is equal to another object id.


hashCode

public int hashCode()
Returns a hash code for this object id.

Overrides:
hashCode in class java.lang.Object
Returns:
a hash code for this object id.

toString

public java.lang.String toString()
String representation of this object id.

Overrides:
toString in class java.lang.Object

EAF 7.4 API