public class WGDocumentListCache
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
java.util.List<WGDocument> |
buildDocumentList(WGDatabase db)
Rebuilds the document list from cache
The method will return null if the number of documents in the list that must be gathered
from backend exceeds the database configuration on
WGDatabase.getListCacheRebuildThreshold() |
java.util.List |
buildDocumentSubList(WGDatabase db,
int offset,
int size)
Rebuilds the document list from cache
The method will return null if the number of documents in the list that must be gathered
from backend exceeds the database configuration on
WGDatabase.getListCacheRebuildThreshold() |
static WGDocumentListCache |
buildFromDocuments(java.util.Collection<? extends WGDocument> col) |
static WGDocumentListCache |
buildFromDocuments(java.util.List<? extends WGDocument> col,
int offset,
int size)
Builds a document list cache from a collection containing
WGDocument objects |
WGDocumentListCache |
clone() |
boolean |
containsKey(WGDocumentKey key)
Returns if the given document key is currently contained in the cache.
|
boolean |
isComplete() |
boolean |
isReachedEnd() |
WGDocumentListCache |
mergeWithDocuments(java.util.List<? extends WGDocument> docs,
int offset,
int size)
Creates a new cache with the entries of this collection and the entries of the given list merged
|
void |
remove(WGDocument doc) |
void |
remove(WGDocumentKey docKey) |
int |
size() |
public boolean isComplete()
public static WGDocumentListCache buildFromDocuments(java.util.List<? extends WGDocument> col, int offset, int size)
WGDocument
objectscol
- The collectionoffset
- The offset of the given collection inside the listsize
- The initially requested size of the collection. If this is larger than col size it is interpreted that the remaining requested docs do not exist, i.e. the collection is smaller than requested.public static WGDocumentListCache buildFromDocuments(java.util.Collection<? extends WGDocument> col)
public java.util.List<WGDocument> buildDocumentList(WGDatabase db)
WGDatabase.getListCacheRebuildThreshold()
db
- The database that the documents belong topublic java.util.List buildDocumentSubList(WGDatabase db, int offset, int size)
WGDatabase.getListCacheRebuildThreshold()
db
- The database that the documents belong tooffset
- The offset from which to return entries, 0 being the first onesize
- The number of entries to return at maximumpublic void remove(WGDocument doc)
public void remove(WGDocumentKey docKey)
public int size()
public boolean isReachedEnd()
public WGDocumentListCache mergeWithDocuments(java.util.List<? extends WGDocument> docs, int offset, int size)
entries
- offset
- size
- public WGDocumentListCache clone()
clone
in class java.lang.Object
public boolean containsKey(WGDocumentKey key)
key
- The key