org.nakedobjects.runtime.persistence.oidgenerator.simple
Class SerialOid
java.lang.Object
org.nakedobjects.runtime.persistence.oidgenerator.simple.SerialOid
- All Implemented Interfaces:
- java.io.Serializable, Oid, DirectlyStringableOid, Encodable
public final class SerialOid
- extends java.lang.Object
- implements Oid, Encodable, java.io.Serializable, DirectlyStringableOid
- See Also:
- Serialized Form
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
SerialOid
public SerialOid(DataInputExtended input)
throws java.io.IOException
- Throws:
java.io.IOException
createPersistent
public static SerialOid createPersistent(long serialNo)
createTransient
public static SerialOid createTransient(long serialNo)
encode
public void encode(DataOutputExtended output)
throws java.io.IOException
- Specified by:
encode in interface Encodable
- Throws:
java.io.IOException
deString
public static SerialOid deString(java.lang.String oidStr)
- See Also:
DirectlyStringableOid,
enString()
enString
public java.lang.String enString()
- Returns a well-defined format which can be converted back using
deString(String).
The options are:
- For transient with no previous: TOID#12AB where the initial T indicates transient and after the
# is the serial number in hex.
- For persistent with previous: OID#12ED+TOID#12AB where after the + is the previous OID, encoded
- For persistent with no previous: OID#12ED.
- Specified by:
enString in interface DirectlyStringableOid
- See Also:
DirectlyStringableOid,
deString(String)
isTransient
public boolean isTransient()
- Specified by:
isTransient in interface Oid
copyFrom
public void copyFrom(Oid oid)
- Specified by:
copyFrom in interface Oid
getPrevious
public Oid getPrevious()
- Specified by:
getPrevious in interface Oid
hasPrevious
public boolean hasPrevious()
- Specified by:
hasPrevious in interface Oid
clearPrevious
public void clearPrevious()
- Specified by:
clearPrevious in interface Oid
setId
public void setId(long serialNo)
- Should be called prior to
makePersistent()
makePersistent
public void makePersistent()
- Specified by:
makePersistent in interface Oid
getSerialNo
public long getSerialNo()
equals
public boolean equals(java.lang.Object other)
- Overrides:
equals in class java.lang.Object
equals
public boolean equals(SerialOid other)
- Overloaded to allow compiler to link directly if we know the compile-time type.
(possible performance improvement - called 166,000 times in normal ref data fixture.
hashCode
public int hashCode()
- Overrides:
hashCode in class java.lang.Object
toString
public java.lang.String toString()
- Overrides:
toString in class java.lang.Object
Copyright © 2001-2009 Naked Objects Group Ltd.. All Rights Reserved.