public class CacheObject<V> extends Object implements Serializable, Comparable<CacheObject<V>>
| 限定符和类型 | 字段和说明 |
|---|---|
protected V |
data
data
|
protected long |
enterTime
time first put into cache, in mills
|
protected boolean |
isExpired
whether has expired, default is false
|
protected boolean |
isForever
whether is valid forever, default is false
|
protected long |
lastUsedTime
time last used(got), in mills
|
protected int |
priority
priority, default is zero
|
protected long |
usedCount
used(got) count
|
| 构造器和说明 |
|---|
CacheObject() |
CacheObject(V data) |
| 限定符和类型 | 方法和说明 |
|---|---|
int |
compareTo(CacheObject<V> o)
compare with data
|
boolean |
equals(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
|
protected long enterTime
protected long lastUsedTime
protected long usedCount
protected int priority
protected boolean isExpired
protected boolean isForever
protected V data
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 在接口中 Comparable<CacheObject<V>>o - public boolean equals(Object o)
Copyright © 2012-2014. All Rights Reserved.