Package net.metanotion.util.skiplist
Class SkipLevels<K extends Comparable<? super K>,V>
java.lang.Object
net.metanotion.util.skiplist.SkipLevels<K,V>
- All Implemented Interfaces:
Flushable
- Direct Known Subclasses:
BSkipLevels
public class SkipLevels<K extends Comparable<? super K>,V> extends Object implements Flushable
-
Field Summary
-
Constructor Summary
Constructors Modifier Constructor Description protected
SkipLevels()
SkipLevels(int size, SkipSpan<K,V> span)
-
Method Summary
Modifier and Type Method Description boolean
blvlck(boolean fix)
boolean
blvlck(boolean fix, int width, SkipLevels<K,V>[] prevLevels)
void
flush()
V
get(int start, K key)
SkipSpan<K,V>
getEnd()
SkipSpan<K,V>
getSpan(int start, K key, int[] search)
K
key()
void
killInstance()
SkipLevels<K,V>
newInstance(int levels, SkipSpan<K,V> ss, SkipList<K,V> sl)
String
print()
String
printAll()
SkipLevels<K,V>
put(int start, K key, V val, SkipList<K,V> sl)
Object[]
remove(int start, K key, SkipList<K,V> sl)
-
Field Details
-
MAX_SIZE
public static final int MAX_SIZEWe can't have more than 2**32 pages- See Also:
- Constant Field Values
-
levels
-
bottom
-
-
Constructor Details
-
SkipLevels
protected SkipLevels() -
SkipLevels
-
-
Method Details
-
newInstance
-
killInstance
public void killInstance() -
flush
public void flush() -
print
-
printAll
-
getEnd
-
getSpan
-
key
-
get
-
remove
- Returns:
- An array of two objects or null. rv[0] is the removed object. rv[1] is the deleted SkipLevels if the removed object was the last in the SkipLevels, and the deleted SkipLevels is taller than this SkipLevels. rv is null if no object was removed.
-
put
- Returns:
- the new level if it caused a split and we made a new level, and the new level is taller than our level; else null if it went in an existing level or the new level is our height or less.
-
blvlck
public boolean blvlck(boolean fix) -
blvlck
-