protected final class BufferManager.CloseableSortingBuffer<K,V> extends BufferManager.CloseableBuffer implements BufferManager.SortingBuffer<K,V>
name, onHeap
Modifier | Constructor and Description |
---|---|
protected |
CloseableSortingBuffer(String name,
boolean onHeap,
NavigableMap<K,V> buffer) |
Modifier and Type | Method and Description |
---|---|
Iterator<V> |
ascending()
Get an iterator over all of the records in ascending order.
|
Iterator<V> |
descending()
Get an iterator over all of the records in descending order.
|
Iterator<V> |
getAll(K key)
Get an iterator over all of the records that have the given sortable value.
|
Iterator<V> |
getAll(K lowerKey,
boolean includeLowerKey,
K upperKey,
boolean includeUpperKey)
Get an iterator over all of the records that have a sortable value with in the specified range.
|
boolean |
isEmpty()
Determine if this buffer is empty.
|
void |
put(K sortable,
V record)
Put the supplied value into the buffer given its sortable value.
|
long |
size()
Get the size of the buffer.
|
String |
toString() |
close
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
close
protected CloseableSortingBuffer(String name, boolean onHeap, NavigableMap<K,V> buffer)
public boolean isEmpty()
BufferManager.Buffer
BufferManager.Buffer.size()
.isEmpty
in interface BufferManager.Buffer
public long size()
BufferManager.Buffer
size
in interface BufferManager.Buffer
public void put(K sortable, V record)
BufferManager.SortingBuffer
put
in interface BufferManager.SortingBuffer<K,V>
sortable
- the value of the record that is to be used for sortingrecord
- the recordpublic Iterator<V> getAll(K key)
BufferManager.SortingBuffer
getAll
in interface BufferManager.SortingBuffer<K,V>
key
- the sortable valuepublic Iterator<V> getAll(K lowerKey, boolean includeLowerKey, K upperKey, boolean includeUpperKey)
BufferManager.SortingBuffer
getAll
in interface BufferManager.SortingBuffer<K,V>
lowerKey
- the minimum sortable value; may be null if there is no minimumincludeLowerKey
- true if the values equal to or greater than lowerKey
value is to be included, or false
if only values greater than lowerKey
should be includedupperKey
- the maximum sortable value; may be null if there is no maximumincludeUpperKey
- true if the values equal to or less than upperKey
value are to be included, or false if
only values less than upperKey
should be includedpublic Iterator<V> ascending()
BufferManager.SortingBuffer
ascending
in interface BufferManager.SortingBuffer<K,V>
public Iterator<V> descending()
BufferManager.SortingBuffer
descending
in interface BufferManager.SortingBuffer<K,V>
Copyright © 2008–2016 JBoss, a division of Red Hat. All rights reserved.