|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.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)
DataVersionother. 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 DataVersionpublic java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(java.lang.Object other)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic long getRawVersion()
public void writeExternal(java.io.ObjectOutput objectOutput)
throws java.io.IOException
writeExternal in interface java.io.Externalizablejava.io.IOException
public void readExternal(java.io.ObjectInput objectInput)
throws java.io.IOException,
java.lang.ClassNotFoundException
readExternal in interface java.io.Externalizablejava.io.IOException
java.lang.ClassNotFoundException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||