Package org.apache.jena.dboe.base.buffer
Class RecordBuffer
- java.lang.Object
-
- org.apache.jena.dboe.base.buffer.RecordBuffer
-
public final class RecordBuffer extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static booleanCheckBuffer
-
Constructor Summary
Constructors Constructor Description RecordBuffer(java.nio.ByteBuffer bb, RecordFactory recFactory, int num)RecordBuffer(RecordFactory recFactory, int maxRec)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <X> X_access(int idx, byte[] key, RecordMapper<X> mapper)Record_get(int idx)<X> Xaccess(int idx, byte[] key, RecordMapper<X> mapper)voidadd(int idx, Record record)voidadd(Record record)voidclear()Does not reset the sizevoidclear(int idx)Does not reset the sizevoidclear(int idx, int len)Does not reset the sizevoidcopy(int srcIdx, org.apache.jena.dboe.base.buffer.BufferBase dst, int dstIdx, int len)voidcopyToTop(org.apache.jena.dboe.base.buffer.BufferBase dst)voiddecSize()voiddecSize(int n)RecordBufferduplicate()A duplicate which does not share anything with the original - for testingintfind(Record k)intfind(Record rec, int fromIndex, int toIndex)Search for key in range fromIndex (inclusive) to toIndex (exclusive)RecordfindGet(Record k)Recordget(int idx)RecordgetHigh()RecordgetLow()intgetSize()voidincSize()voidincSize(int n)booleanisClear(int idx)Is the record at idx set clear or not? This is done without regard to buffer size.booleanisEmpty()booleanisFull()java.util.Iterator<Record>iterator()java.util.Iterator<Record>iterator(Record min, Record max)Iterator over a range from min (inclusive) to max(exclusive)<X> java.util.Iterator<X>iterator(Record min, Record max, RecordMapper<X> mapper)intmaxSize()voidremove(int idx)booleanremoveByKey(Record k)return true is removed anythingvoidremoveTop()Remove top elementvoidset(int idx, Record record)voidsetSize(int n)voidshiftDown(int idx)voidshiftDownN(int idx, int num)voidshiftLeft(org.apache.jena.dboe.base.buffer.BufferBase other)Move the element from the low end of other to the high end of thisvoidshiftRight(org.apache.jena.dboe.base.buffer.BufferBase other)Move the element from the high end of this to the low end of othervoidshiftUp(int idx)voidshiftUpN(int idx, int num)intsize()intslotLen()java.lang.StringtoString()
-
-
-
Field Detail
-
CheckBuffer
public static final boolean CheckBuffer
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
RecordBuffer
public RecordBuffer(RecordFactory recFactory, int maxRec)
-
RecordBuffer
public RecordBuffer(java.nio.ByteBuffer bb, RecordFactory recFactory, int num)
-
-
Method Detail
-
access
public <X> X access(int idx, byte[] key, RecordMapper<X> mapper)
-
get
public Record get(int idx)
-
getLow
public Record getLow()
-
getHigh
public Record getHigh()
-
add
public void add(Record record)
-
add
public void add(int idx, Record record)
-
set
public void set(int idx, Record record)
-
_access
public <X> X _access(int idx, byte[] key, RecordMapper<X> mapper)
-
_get
public Record _get(int idx)
-
find
public int find(Record k)
-
iterator
public java.util.Iterator<Record> iterator()
-
iterator
public java.util.Iterator<Record> iterator(Record min, Record max)
Iterator over a range from min (inclusive) to max(exclusive)
-
iterator
public <X> java.util.Iterator<X> iterator(Record min, Record max, RecordMapper<X> mapper)
-
removeByKey
public boolean removeByKey(Record k)
return true is removed anything
-
find
public int find(Record rec, int fromIndex, int toIndex)
Search for key in range fromIndex (inclusive) to toIndex (exclusive)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
duplicate
public RecordBuffer duplicate()
A duplicate which does not share anything with the original - for testing
-
copy
public final void copy(int srcIdx, org.apache.jena.dboe.base.buffer.BufferBase dst, int dstIdx, int len)
-
copyToTop
public final void copyToTop(org.apache.jena.dboe.base.buffer.BufferBase dst)
-
removeTop
public final void removeTop()
Remove top element
-
remove
public final void remove(int idx)
-
clear
public final void clear(int idx, int len)Does not reset the size
-
clear
public final void clear()
Does not reset the size
-
clear
public final void clear(int idx)
Does not reset the size
-
isClear
public final boolean isClear(int idx)
Is the record at idx set clear or not? This is done without regard to buffer size. Requires NullOut to be accurate. Testing.
-
isFull
public final boolean isFull()
-
isEmpty
public final boolean isEmpty()
-
incSize
public final void incSize()
-
incSize
public final void incSize(int n)
-
decSize
public final void decSize()
-
decSize
public final void decSize(int n)
-
slotLen
public final int slotLen()
-
getSize
public final int getSize()
-
setSize
public final void setSize(int n)
-
size
public final int size()
-
maxSize
public final int maxSize()
-
shiftUp
public final void shiftUp(int idx)
-
shiftUpN
public final void shiftUpN(int idx, int num)
-
shiftDown
public final void shiftDown(int idx)
-
shiftDownN
public final void shiftDownN(int idx, int num)
-
shiftRight
public void shiftRight(org.apache.jena.dboe.base.buffer.BufferBase other)
Move the element from the high end of this to the low end of other
-
shiftLeft
public void shiftLeft(org.apache.jena.dboe.base.buffer.BufferBase other)
Move the element from the low end of other to the high end of this
-
-