Class WindowCache.SoftRef
- All Implemented Interfaces:
WindowCache.PageRef<ByteWindow>
- Enclosing class:
- WindowCache
private static class WindowCache.SoftRef
extends SoftReference<ByteWindow>
implements WindowCache.PageRef<ByteWindow>
A soft reference wrapped around a cached object.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate long
private final Pack
private final long
private final int
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
SoftRef
(Pack pack, long position, ByteWindow v, WindowCache.SoftCleanupQueue queue) -
Method Summary
Modifier and TypeMethodDescriptionlong
Get pseudo time of last access to this cache pagegetPack()
Get thePack
the referenced cache page is allocated forlong
Get the position of the referenced cache page in thePack
int
getSize()
Get size of cache pageboolean
Whether this is a strong reference.boolean
kill()
Kill this refvoid
setLastAccess
(long time) Set pseudo time of last access to this cache pageMethods inherited from class java.lang.ref.SoftReference
get
Methods inherited from class java.lang.ref.Reference
clear, clone, enqueue, isEnqueued, reachabilityFence, refersTo
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.eclipse.jgit.internal.storage.file.WindowCache.PageRef
get
-
Field Details
-
pack
-
position
private final long position -
size
private final int size -
lastAccess
private long lastAccess
-
-
Constructor Details
-
SoftRef
-
-
Method Details
-
getPack
Description copied from interface:WindowCache.PageRef
Get thePack
the referenced cache page is allocated for- Specified by:
getPack
in interfaceWindowCache.PageRef<ByteWindow>
- Returns:
- the
Pack
the referenced cache page is allocated for
-
getPosition
public long getPosition()Description copied from interface:WindowCache.PageRef
Get the position of the referenced cache page in thePack
- Specified by:
getPosition
in interfaceWindowCache.PageRef<ByteWindow>
- Returns:
- the position of the referenced cache page in the
Pack
-
getSize
public int getSize()Description copied from interface:WindowCache.PageRef
Get size of cache page- Specified by:
getSize
in interfaceWindowCache.PageRef<ByteWindow>
- Returns:
- size of cache page
-
getLastAccess
public long getLastAccess()Description copied from interface:WindowCache.PageRef
Get pseudo time of last access to this cache page- Specified by:
getLastAccess
in interfaceWindowCache.PageRef<ByteWindow>
- Returns:
- pseudo time of last access to this cache page
-
setLastAccess
public void setLastAccess(long time) Description copied from interface:WindowCache.PageRef
Set pseudo time of last access to this cache page- Specified by:
setLastAccess
in interfaceWindowCache.PageRef<ByteWindow>
- Parameters:
time
- pseudo time of last access to this cache page
-
kill
public boolean kill()Description copied from interface:WindowCache.PageRef
Kill this ref- Specified by:
kill
in interfaceWindowCache.PageRef<ByteWindow>
- Returns:
true
if this reference object was successfully killed;false
if it was already killed
-
isStrongRef
public boolean isStrongRef()Description copied from interface:WindowCache.PageRef
Whether this is a strong reference.- Specified by:
isStrongRef
in interfaceWindowCache.PageRef<ByteWindow>
- Returns:
true
if this is a strong reference
-