com.alachisoft.jvcache.web.caching
Class CacheItemVersion

java.lang.Object
  extended by com.alachisoft.jvcache.web.caching.CacheItemVersion
All Implemented Interfaces:
java.lang.Comparable<CacheItemVersion>

public final class CacheItemVersion
extends java.lang.Object
implements java.lang.Comparable<CacheItemVersion>

Represents the version of each cache item. An instance of this class is used in the optimistic concurrency model to ensure the data integrity.


Constructor Summary
CacheItemVersion()
           
 
Method Summary
 int compareTo(CacheItemVersion itemVersion)
          Compare CacheItemVersion with current instance of item version
 long getVersion()
          Get item version
 void setVersion(long version)
          Set item version
 java.lang.String toString()
          The string representation of this class.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CacheItemVersion

public CacheItemVersion()
Method Detail

getVersion

public long getVersion()
Get item version

Returns:
Item's version

setVersion

public void setVersion(long version)
Set item version

Parameters:
version - Item's version

toString

public java.lang.String toString()
The string representation of this class.

Overrides:
toString in class java.lang.Object
Returns:
a string representation of the object.

compareTo

public int compareTo(CacheItemVersion itemVersion)
Compare CacheItemVersion with current instance of item version

Specified by:
compareTo in interface java.lang.Comparable<CacheItemVersion>
Parameters:
itemVersion - item version to be compared
Returns:
0 if two instance are equal. An integer greater then 0 if this instance is greater. An integer less than 0 if this instance is smaller