private static class WindowCache.SoftRef extends java.lang.ref.SoftReference<ByteWindow> implements WindowCache.PageRef<ByteWindow>
Modifier and Type | Field and Description |
---|---|
private long |
lastAccess |
private PackFile |
pack |
private long |
position |
private int |
size |
Modifier | Constructor and Description |
---|---|
protected |
SoftRef(PackFile pack,
long position,
ByteWindow v,
WindowCache.SoftCleanupQueue queue) |
Modifier and Type | Method and Description |
---|---|
long |
getLastAccess()
Get pseudo time of last access to this cache page
|
PackFile |
getPack()
Get the packfile the referenced cache page is allocated for
|
long |
getPosition()
Get the position of the referenced cache page in the packfile
|
int |
getSize()
Get size of cache page
|
boolean |
isStrongRef()
Whether this is a strong reference.
|
boolean |
kill()
Kill this ref
|
void |
setLastAccess(long time)
Set pseudo time of last access to this cache page
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
get
private final PackFile pack
private final long position
private final int size
private long lastAccess
protected SoftRef(PackFile pack, long position, ByteWindow v, WindowCache.SoftCleanupQueue queue)
public PackFile getPack()
WindowCache.PageRef
getPack
in interface WindowCache.PageRef<ByteWindow>
public long getPosition()
WindowCache.PageRef
getPosition
in interface WindowCache.PageRef<ByteWindow>
public int getSize()
WindowCache.PageRef
getSize
in interface WindowCache.PageRef<ByteWindow>
public long getLastAccess()
WindowCache.PageRef
getLastAccess
in interface WindowCache.PageRef<ByteWindow>
public void setLastAccess(long time)
WindowCache.PageRef
setLastAccess
in interface WindowCache.PageRef<ByteWindow>
time
- pseudo time of last access to this cache pagepublic boolean kill()
WindowCache.PageRef
kill
in interface WindowCache.PageRef<ByteWindow>
true
if this reference object was successfully
killed; false
if it was already killedpublic boolean isStrongRef()
WindowCache.PageRef
isStrongRef
in interface WindowCache.PageRef<ByteWindow>
true
if this is a strong reference