public class CacheObject<V> extends java.lang.Object implements java.io.Serializable, java.lang.Comparable<CacheObject<V>>
Constructor and Description |
---|
CacheObject() |
CacheObject(V data) |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(CacheObject<V> o)
compare with data
|
boolean |
equals(java.lang.Object o)
if data, enterTime, priority, isExpired, isForever all equals
|
long |
getAndIncrementUsedCount()
Atomically increments by one the used(got) count
|
V |
getData()
Get data
|
long |
getEnterTime()
Get time first put into cache, in mills
|
long |
getLastUsedTime()
Get time last used(got), in mills
|
int |
getPriority()
Get priority, default is zero
|
long |
getUsedCount()
Get used(got) count
|
int |
hashCode() |
boolean |
isExpired()
Get whether has expired, default is false
|
boolean |
isForever()
Get whether is valid forever, default is false
|
void |
setData(V data)
Set data
|
void |
setEnterTime(long enterTime)
Set time first put into cache, in mills
|
void |
setExpired(boolean isExpired)
Set whether has expired, default is false
|
void |
setForever(boolean isForever)
Set whether is valid forever, default is false
|
void |
setLastUsedTime(long lastUsedTime)
Set time last used(got), in mills
|
void |
setPriority(int priority)
Set priority, default is zero
|
void |
setUsedCount(long usedCount)
Set used(got) count
|
public CacheObject()
public CacheObject(V data)
public long getEnterTime()
public void setEnterTime(long enterTime)
enterTime
- public long getLastUsedTime()
public void setLastUsedTime(long lastUsedTime)
lastUsedTime
- public long getUsedCount()
public void setUsedCount(long usedCount)
usedCount
- public long getAndIncrementUsedCount()
public int getPriority()
public void setPriority(int priority)
priority
- public boolean isExpired()
public void setExpired(boolean isExpired)
isExpired
- public boolean isForever()
public void setForever(boolean isForever)
isForever
- public V getData()
public void setData(V data)
data
- public int compareTo(CacheObject<V> o)
compareTo
in interface java.lang.Comparable<CacheObject<V>>
o
- public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object