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 longprivate final Packprivate final longprivate final int -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedSoftRef(Pack pack, long position, ByteWindow v, WindowCache.SoftCleanupQueue queue) -
Method Summary
Modifier and TypeMethodDescriptionlongGet pseudo time of last access to this cache pagegetPack()Get thePackthe referenced cache page is allocated forlongGet the position of the referenced cache page in thePackintgetSize()Get size of cache pagebooleanWhether this is a strong reference.booleankill()Kill this refvoidsetLastAccess(long time) Set pseudo time of last access to this cache pageMethods inherited from class java.lang.ref.SoftReference
getMethods inherited from class java.lang.ref.Reference
clear, clone, enqueue, isEnqueued, reachabilityFence, refersToMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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.PageRefGet thePackthe referenced cache page is allocated for- Specified by:
getPackin interfaceWindowCache.PageRef<ByteWindow>- Returns:
- the
Packthe referenced cache page is allocated for
-
getPosition
public long getPosition()Description copied from interface:WindowCache.PageRefGet the position of the referenced cache page in thePack- Specified by:
getPositionin interfaceWindowCache.PageRef<ByteWindow>- Returns:
- the position of the referenced cache page in the
Pack
-
getSize
public int getSize()Description copied from interface:WindowCache.PageRefGet size of cache page- Specified by:
getSizein interfaceWindowCache.PageRef<ByteWindow>- Returns:
- size of cache page
-
getLastAccess
public long getLastAccess()Description copied from interface:WindowCache.PageRefGet pseudo time of last access to this cache page- Specified by:
getLastAccessin interfaceWindowCache.PageRef<ByteWindow>- Returns:
- pseudo time of last access to this cache page
-
setLastAccess
public void setLastAccess(long time) Description copied from interface:WindowCache.PageRefSet pseudo time of last access to this cache page- Specified by:
setLastAccessin interfaceWindowCache.PageRef<ByteWindow>- Parameters:
time- pseudo time of last access to this cache page
-
kill
public boolean kill()Description copied from interface:WindowCache.PageRefKill this ref- Specified by:
killin interfaceWindowCache.PageRef<ByteWindow>- Returns:
trueif this reference object was successfully killed;falseif it was already killed
-
isStrongRef
public boolean isStrongRef()Description copied from interface:WindowCache.PageRefWhether this is a strong reference.- Specified by:
isStrongRefin interfaceWindowCache.PageRef<ByteWindow>- Returns:
trueif this is a strong reference
-