WebObjects 5.2

com.webobjects.eocontrol
Class EOTemporaryGlobalID

java.lang.Object
  |
  +--com.webobjects.eocontrol.EOGlobalID
        |
        +--com.webobjects.eocontrol.EOTemporaryGlobalID
All Implemented Interfaces:
Cloneable, NSCoding, Serializable

public class EOTemporaryGlobalID
extends EOGlobalID
implements NSCoding

An EOTemporaryGlobalID object identifies a newly created enterprise object before it's saved to an external store. When the object is saved, the temporary ID is converted to a permanent one, as described in the EOGlobalID class specification.

See Also:
EOGlobalID, Serialized Form

Inner classes inherited from class com.webobjects.foundation.NSCoding
NSCoding.Support
 
Field Summary
static int UniqueBinaryKeyLength
          The following int constant specifies the length (in bytes) of a global ID.
 
Fields inherited from class com.webobjects.eocontrol.EOGlobalID
GlobalIDChangedNotification
 
Constructor Summary
  EOTemporaryGlobalID()
          Creates and returns an EOTemporaryGlobalID as a unique instance.
protected EOTemporaryGlobalID(byte[] globallyUniqueBytes)
          Creates and returns an EOTemporaryGlobalID as a unique instance.
 
Method Summary
static void assignGloballyUniqueBytes(byte[] uniqueBytes)
          Assigns to uniqueBytes an array of bytes that represent a byte string that's guaranteed to be unique network wide.
 Class classForCoder()
          Allows the receiver, before being encoded, to substitute a class other than its own in a coder.
static Object decodeObject(NSCoder coder)
           
 void encodeWithCoder(NSCoder coder)
          Encodes the receiver using coder.
 boolean equals(Object object)
          Compares the receiver to object.
 int hashCode()
          Provides an appropriate hash code useful for storing the receiver in a hash-based data structure.
 boolean isTemporary()
          Used to find out if the the globalID is temporary or not.
 String toString()
          String represntation of an EOTemporaryGlobalID.
 
Methods inherited from class com.webobjects.eocontrol.EOGlobalID
clone
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

UniqueBinaryKeyLength

public static final int UniqueBinaryKeyLength
The following int constant specifies the length (in bytes) of a global ID.
Constructor Detail

EOTemporaryGlobalID

public EOTemporaryGlobalID()
Creates and returns an EOTemporaryGlobalID as a unique instance. The returned object contains a byte string that's guaranteed to be unique network wide. As a result, EOTemporaryGlobalIDs can be safely passed between processes and machines while still preserving global uniqueness. The returned byte string has the format:

 < Sequence [2], ProcessID [2] , Time [4], IP Addr [4] >
 

EOTemporaryGlobalID

protected EOTemporaryGlobalID(byte[] globallyUniqueBytes)
Creates and returns an EOTemporaryGlobalID as a unique instance. It uses ,as input, an array of bytes in order to create this unique global ID.
Parameters:
globallyUniqueBytes - an array of bytes describing a unique id
Method Detail

assignGloballyUniqueBytes

public static void assignGloballyUniqueBytes(byte[] uniqueBytes)
Assigns to uniqueBytes an array of bytes that represent a byte string that's guaranteed to be unique network wide. The size of the uniqueBytes array should be at least the value of UniqueBinaryKeyLength constant. The returned byte string has the format:

 < Sequence [2], ProcessID [2] , Time [4], IP Addr [4] >
 
See Also:
EOTemporaryGlobalID, UniqueBinaryKeyLength

classForCoder

public Class classForCoder()
Description copied from interface: NSCoding
Allows the receiver, before being encoded, to substitute a class other than its own in a coder. For example, private subclasses can substitute the name of a public superclass when being encoded.
Specified by:
classForCoder in interface NSCoding
Following copied from interface: com.webobjects.foundation.NSCoding
Returns:
the class a coder should record

decodeObject

public static Object decodeObject(NSCoder coder)

encodeWithCoder

public void encodeWithCoder(NSCoder coder)
Description copied from interface: NSCoding
Encodes the receiver using coder. Object type information along with an object's data is stored.
Specified by:
encodeWithCoder in interface NSCoding
Following copied from interface: com.webobjects.foundation.NSCoding
Parameters:
coder - an NSCoder object that will be used to encode object of classes that implement this interface
See Also:
NSCoder

equals

public boolean equals(Object object)
Compares the receiver to object. If the contents of object are equal to the contents of the receiver, this method returns true. If not, it returns false. Two data objects are equal if they hold the same number of bytes, if both have the same hash code and if the bytes at the same position in the objects are the same.
Overrides:
equals in class EOGlobalID
Parameters:
object - input object against which the receiver is compared
Returns:
true if the objects are equal; false otherwise

hashCode

public int hashCode()
Description copied from class: EOGlobalID
Provides an appropriate hash code useful for storing the receiver in a hash-based data structure.
Overrides:
hashCode in class EOGlobalID
Following copied from class: com.webobjects.eocontrol.EOGlobalID
Returns:
hash code int useful for storing the receiver in a hash-based data structure

isTemporary

public boolean isTemporary()
Used to find out if the the globalID is temporary or not. This method implementation returns true.
Overrides:
isTemporary in class EOGlobalID
Returns:
true

toString

public String toString()
String represntation of an EOTemporaryGlobalID.
Overrides:
toString in class Object
Returns:
a String representing the array of bytes that form the temporary globalID

Last updated Fri Feb 21 13:15:00 PST 2003.

Copyright © 2003 Apple Computer, Inc.