V - the type of the value stored by this AbstractNearCacheRecordpublic abstract class AbstractNearCacheRecord<V> extends Object implements NearCacheRecord<V>
NearCacheRecord with value and
expiration time as internal state.| Modifier and Type | Field and Description |
|---|---|
protected int |
accessHit |
protected long |
accessTime |
protected long |
creationTime |
protected long |
expirationTime |
protected V |
value |
TIME_NOT_SET| Constructor and Description |
|---|
AbstractNearCacheRecord(V value,
long creationTime,
long expirationTime) |
| Modifier and Type | Method and Description |
|---|---|
int |
getAccessHit()
Gets the access hit count of this
Evictable. |
long |
getCreationTime()
Gets the creation time of this
Evictable in milliseconds. |
long |
getExpirationTime()
Gets the expiration time in milliseconds.
|
long |
getLastAccessTime()
Gets the latest access time difference of this
Evictable in milliseconds. |
V |
getValue()
Gets the value of this
Evictable. |
void |
incrementAccessHit()
Increases the access hit count of this
Evictable as 1. |
boolean |
isExpiredAt(long now)
Checks whether the expiration time is passed with respect to the provided time.
|
boolean |
isIdleAt(long maxIdleMilliSeconds,
long now)
Checks whether the maximum idle time is passed with respect to the provided time
without any access during this time period as
maxIdleSeconds. |
void |
resetAccessHit()
Resets the access hit count of this
Evictable to 0. |
void |
setAccessHit(int accessHit)
Sets the access hit count of this
Evictable. |
void |
setAccessTime(long accessTime)
Sets the access time of this
Evictable in milliseconds. |
void |
setCreationTime(long creationTime)
Sets the creation time of this
Evictable in milliseconds. |
void |
setExpirationTime(long expirationTime)
Sets the expiration time in milliseconds.
|
void |
setValue(V value)
Sets the value of this
NearCacheRecord. |
protected V value
protected long creationTime
protected volatile long expirationTime
protected volatile long accessTime
protected volatile int accessHit
public AbstractNearCacheRecord(V value, long creationTime, long expirationTime)
public V getValue()
EvictableEvictable.public void setValue(V value)
NearCacheRecordNearCacheRecord.setValue in interface NearCacheRecord<V>value - the value for this NearCacheRecordpublic long getExpirationTime()
ExpirablegetExpirationTime in interface ExpirableSystem.currentTimeMillis()public void setExpirationTime(long expirationTime)
ExpirablesetExpirationTime in interface ExpirableSystem.currentTimeMillis()public long getCreationTime()
EvictableEvictable in milliseconds.getCreationTime in interface Evictable<V>Evictable in millisecondspublic void setCreationTime(long creationTime)
NearCacheRecordEvictable in milliseconds.setCreationTime in interface NearCacheRecord<V>creationTime - the creation time for this Evictable in millisecondspublic long getLastAccessTime()
EvictableEvictable in milliseconds.getLastAccessTime in interface Evictable<V>Evictable in millisecondspublic void setAccessTime(long accessTime)
NearCacheRecordEvictable in milliseconds.setAccessTime in interface NearCacheRecord<V>accessTime - the latest access time of this Evictable in millisecondspublic int getAccessHit()
EvictableEvictable.getAccessHit in interface Evictable<V>Evictablepublic void setAccessHit(int accessHit)
NearCacheRecordEvictable.setAccessHit in interface NearCacheRecord<V>accessHit - the access hit count for this Evictablepublic void incrementAccessHit()
NearCacheRecordEvictable as 1.incrementAccessHit in interface NearCacheRecord<V>public void resetAccessHit()
NearCacheRecordEvictable to 0.resetAccessHit in interface NearCacheRecord<V>public boolean isExpiredAt(long now)
ExpirableReturns true if and only if now > getExpirationTime()
isExpiredAt in interface Expirablenow - time in milliseconds.public boolean isIdleAt(long maxIdleMilliSeconds,
long now)
NearCacheRecordmaxIdleSeconds.isIdleAt in interface NearCacheRecord<V>maxIdleMilliSeconds - maximum idle time in millisecondsnow - current time in millisecondstrue if exceeds max idle seconds, otherwise falseCopyright © 2016 Hazelcast, Inc.. All Rights Reserved.