private static class WindowCache.StrongRef extends java.lang.Object implements WindowCache.PageRef<ByteWindow>
Modifier and Type | Field and Description |
---|---|
private long |
lastAccess |
private PackFile |
pack |
private long |
position |
private WindowCache.CleanupQueue |
queue |
private ByteWindow |
referent |
private int |
size |
Modifier | Constructor and Description |
---|---|
protected |
StrongRef(PackFile pack,
long position,
ByteWindow v,
WindowCache.CleanupQueue queue) |
Modifier and Type | Method and Description |
---|---|
ByteWindow |
get()
Returns this reference object's referent.
|
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
|
private ByteWindow referent
private final PackFile pack
private final long position
private final int size
private long lastAccess
private WindowCache.CleanupQueue queue
protected StrongRef(PackFile pack, long position, ByteWindow v, WindowCache.CleanupQueue 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 ByteWindow get()
WindowCache.PageRef
null
.get
in interface WindowCache.PageRef<ByteWindow>
null
if this reference object has been clearedpublic 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