Package net.metanotion.util.skiplist
Class SkipSpan<K extends Comparable<? super K>,V>
- java.lang.Object
-
- net.metanotion.util.skiplist.SkipSpan<K,V>
-
- All Implemented Interfaces:
Flushable
- Direct Known Subclasses:
BSkipSpan
public class SkipSpan<K extends Comparable<? super K>,V> extends Object implements Flushable
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description KfirstKey()I2Pvoidflush()Vget(K key)SkipSpan<K,V>getEnd()SkipSpan<K,V>getSpan(K key, int[] search)voidkillInstance()SkipSpan<K,V>newInstance(SkipList<K,V> sl)Stringprint()dumps all the data from here to the endSkipSpan<K,V>put(K key, V val, SkipList<K,V> sl)Object[]remove(K key, SkipList<K,V> sl)
-
-
-
Field Detail
-
MAX_SIZE
public static final int MAX_SIZE
This is actually limited by BlockFile.spanSize which is much smaller- See Also:
- Constant Field Values
-
nKeys
public int nKeys
-
keys
public K extends Comparable<? super K>[] keys
-
vals
public V[] vals
-
next
public SkipSpan<K extends Comparable<? super K>,V> next
-
prev
public SkipSpan<K extends Comparable<? super K>,V> prev
-
-
Method Detail
-
killInstance
public void killInstance()
-
print
public String print()
dumps all the data from here to the end
-
put
public SkipSpan<K,V> put(K key, V val, SkipList<K,V> sl)
- Returns:
- the new span if it caused a split, else null if it went in an existing span
-
remove
public Object[] remove(K key, SkipList<K,V> sl)
- Returns:
- An array of two objects or null. rv[0] is the removed object. rv[1] is the deleted SkipSpan if the removed object was the last in the SkipSpan. rv is null if no object was removed.
-
firstKey
public K firstKey()
I2P
-
-