|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jboss.cache.optimistic.DefaultDataVersion
public class DefaultDataVersion
The default implementation of a DataVersion, uses a long
to
compare versions.
This class is immutable.
Also note that this is meant to control implicit, internal versioning. Do not attempt to instantiate or use instances
of this class explicitly, via the Option.setDataVersion(DataVersion)
API, as it WILL
break things.
Field Summary | |
---|---|
static DataVersion |
ZERO
Version zero. |
Constructor Summary | |
---|---|
DefaultDataVersion()
Constructs with version 0. |
|
DefaultDataVersion(long version)
Constructs with a version number. |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object other)
|
long |
getRawVersion()
|
int |
hashCode()
|
DataVersion |
increment()
Returns a new DataVersion with a newer version number. |
boolean |
newerThan(DataVersion other)
Returns true if this is a newer version than other . |
void |
readExternal(java.io.ObjectInput objectInput)
|
java.lang.String |
toString()
|
void |
writeExternal(java.io.ObjectOutput objectOutput)
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final DataVersion ZERO
Constructor Detail |
---|
public DefaultDataVersion()
public DefaultDataVersion(long version)
Method Detail |
---|
public DataVersion increment()
public boolean newerThan(DataVersion other)
DataVersion
other
. There is no guarantee that the DataVersion
passed in will be of the same implementation, and as such, it is up to the implementation to perform
any type checking if needed before comparison.
newerThan
in interface DataVersion
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public long getRawVersion()
public void writeExternal(java.io.ObjectOutput objectOutput) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
java.io.IOException
public void readExternal(java.io.ObjectInput objectInput) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
java.io.IOException
java.lang.ClassNotFoundException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |