V - The value typeabstract class AbstractValueHolder<V> extends java.lang.Object implements ValueHolder<V>
| Modifier and Type | Field and Description |
|---|---|
protected int |
nbArrayElems |
protected V[] |
valueArray
The array storing from 1 to N values
|
protected BTree<V,V> |
valueBtree
The BTree storing multiple value, if we have more than one value
|
protected ElementSerializer<V> |
valueSerializer
The Value serializer
|
protected int |
valueThresholdLow |
protected int |
valueThresholdUp
The configuration for the array <-> BTree switch.
|
| Constructor and Description |
|---|
AbstractValueHolder() |
| Modifier and Type | Method and Description |
|---|---|
void |
add(V value)
Add a new value in the ValueHolder
|
private void |
addInArray(V value)
Add the value in an array
|
private void |
addInBtree(V value)
Add the value in the subBTree
|
private boolean |
arrayContains(V value)
Check if the array of values contains a given value
|
protected boolean |
btreeContains(V value)
Check if the subBtree contains a given value
|
ValueHolder<V> |
clone()
Create a clone of this instance
|
boolean |
contains(V checkedValue)
Tells if a value is contained in this ValueHolder
|
protected abstract void |
createSubTree()
Create a new Sub-BTree to store the values.
|
private int |
findPos(V value)
Find the position of a given value in the array, or the position where we
would insert the element (in this case, the position will be negative).
|
ValueCursor<V> |
getCursor() |
boolean |
isSubBtree() |
protected abstract void |
manageSubTree()
Manage a new Sub-BTree .
|
V |
replaceValueArray(V newValue)
Replaces the single value present in the array.
|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitremove, sizeprotected BTree<V,V> valueBtree
protected V[] valueArray
protected ElementSerializer<V> valueSerializer
protected int valueThresholdUp
protected int valueThresholdLow
protected int nbArrayElems
public boolean isSubBtree()
isSubBtree in interface ValueHolder<V>public ValueHolder<V> clone() throws java.lang.CloneNotSupportedException
clone in interface ValueHolder<V>clone in class java.lang.Objectjava.lang.CloneNotSupportedException - If we can't clone this instancepublic ValueCursor<V> getCursor()
getCursor in interface ValueHolder<V>private int findPos(V value)
private boolean arrayContains(V value)
protected boolean btreeContains(V value)
public boolean contains(V checkedValue)
contains in interface ValueHolder<V>checkedValue - The added to checkprotected abstract void createSubTree()
protected abstract void manageSubTree()
private void addInArray(V value)
private void addInBtree(V value)
public void add(V value)
add in interface ValueHolder<V>value - The added valuepublic V replaceValueArray(V newValue)
replaceValueArray in interface ValueHolder<V>newValue - the new value