arlut.csd.ganymede
Class Invid

java.lang.Object
  |
  +--arlut.csd.ganymede.Invid
All Implemented Interfaces:
java.io.Serializable

public final class Invid
extends java.lang.Object
implements java.io.Serializable

An Invid is an immutable object id (an INVariant ID) in the Ganymede system. All objects created in the database have a unique and permanent Invid that identify the object's type and identity. Because of these properties, the Invid can be used as a persistent object pointer type.

Invid's are used extensively in the server to track pointer relationships between objects. Invid's are also used by the client to identify objects to be viewed, edited, deleted, etc. Basically whenever any code in Ganymede deals with a reference to an object, it is done through the use of Invid's.

See Also:
InvidDBField, Session, Serialized Form

Field Summary
private  int num
           
(package private) static long serialVersionUID
           
private  short type
           
 
Constructor Summary
Invid(java.io.DataInput in)
          Receive constructor
Invid(short type, int num)
           
Invid(java.lang.String string)
          This is the string constructor..
 
Method Summary
static arlut.csd.ganymede.Invid createInvid(java.io.DataInput in)
          Factory method for Invid's.
static arlut.csd.ganymede.Invid createInvid(short type, int num)
          Receive Factory method for Invid's.
static arlut.csd.ganymede.Invid createInvid(java.lang.String string)
          Factory method for Invid's.
 void emit(java.io.DataOutput out)
          Method to write this Invid out to a stream.
 boolean equals(arlut.csd.ganymede.Invid invid)
           
 boolean equals(java.lang.Object obj)
           
 int getNum()
           
 short getType()
           
 int hashCode()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

static final long serialVersionUID
See Also:
Constant Field Values

type

private short type

num

private int num
Constructor Detail

Invid

public Invid(short type,
             int num)

Invid

public Invid(java.io.DataInput in)
      throws java.io.IOException
Receive constructor


Invid

public Invid(java.lang.String string)

This is the string constructor.. string should be a pair of colon separated numbers, in the form 5:134 where the first number is the short type and the second is the int object number.

Method Detail

createInvid

public static final arlut.csd.ganymede.Invid createInvid(short type,
                                                         int num)

Receive Factory method for Invid's. Does nothing fancy now, could be used to do Invid caching/pooling sometime if we so desire.


createInvid

public static final arlut.csd.ganymede.Invid createInvid(java.io.DataInput in)
                                                  throws java.io.IOException

Factory method for Invid's. Does nothing fancy now, could be used to do Invid caching/pooling sometime if we so desire.

java.io.IOException

createInvid

public static final arlut.csd.ganymede.Invid createInvid(java.lang.String string)

Factory method for Invid's. String should be a pair of colon separated numbers, in the form 5:134 where the first number is the short type and the second is the int object number.


equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

equals

public boolean equals(arlut.csd.ganymede.Invid invid)

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

getType

public short getType()

getNum

public int getNum()

emit

public void emit(java.io.DataOutput out)
          throws java.io.IOException
Method to write this Invid out to a stream.

java.io.IOException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object