T
- Unguarded descriptor typepublic class UnguardedPagedStorageImpl<T extends Serializable> extends Object implements UnguardedPagedStorage<T>
Constructor and Description |
---|
UnguardedPagedStorageImpl(ImmutableList<ImmutableList<T>> pages)
Construct new immutable reference from prepared storage.
|
Modifier and Type | Method and Description |
---|---|
String |
getDescriptorAsString(int index,
boolean recognizeArrays)
Retrieve descriptor as String.
|
T |
getUnguardedDescriptor(int index)
Retrieve a descriptor.
|
UnmodifiableIterator<ImmutableList<T>> |
iterateDescriptorPages()
Iterate descriptor pages.
|
UnmodifiableIterator<ImmutableList<T>> |
iterateDescriptorPages(int pagesize)
Iterate descriptor pages.
|
UnmodifiableIterator<T> |
iterateDescriptors()
Iterate descriptors.
|
int |
size()
Total number of descriptors stored.
|
void |
traverse(UnguardedVisitor<T> visitor,
SubProgressObserver po)
Traverse storage on single thread.
|
public UnguardedPagedStorageImpl(ImmutableList<ImmutableList<T>> pages)
pages
- Non empty list of non empty pages. All but the last page are expected to be the same sized.public int size()
UnguardedPagedStorage
size
in interface UnguardedPagedStorage<T extends Serializable>
public void traverse(UnguardedVisitor<T> visitor, SubProgressObserver po)
UnguardedPagedStorage
Note that the callback must not modify passed descriptors.
traverse
in interface UnguardedPagedStorage<T extends Serializable>
visitor
- Callback to invokepo
- ProgressObserver to track progress. Upon completion ProgressObserver.done()
will be invoked.public UnmodifiableIterator<T> iterateDescriptors()
UnguardedPagedStorage
iterateDescriptors
in interface UnguardedPagedStorage<T extends Serializable>
public UnmodifiableIterator<ImmutableList<T>> iterateDescriptorPages(int pagesize)
UnguardedPagedStorage
iterateDescriptorPages
in interface UnguardedPagedStorage<T extends Serializable>
pagesize
- Number of descriptors to page togetherpublic UnmodifiableIterator<ImmutableList<T>> iterateDescriptorPages()
UnguardedPagedStorage
iterateDescriptorPages
in interface UnguardedPagedStorage<T extends Serializable>
public T getUnguardedDescriptor(int index)
UnguardedPagedStorage
getUnguardedDescriptor
in interface UnguardedPagedStorage<T extends Serializable>
index
- Descriptor indexpublic String getDescriptorAsString(int index, boolean recognizeArrays)
UnguardedPagedStorage
This operation is recommended for debug only. Execution might be slow.
getDescriptorAsString
in interface UnguardedPagedStorage<T extends Serializable>
index
- Index of descriptorrecognizeArrays
- Recognize arrays and traverse its elements