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 Details

  • Constructor Details

    • SkipLevels

      protected SkipLevels()
    • SkipLevels

      public SkipLevels(int size, SkipSpan<K,V> span)
  • Method Details

    • newInstance

      public SkipLevels<K,V> newInstance(int levels, SkipSpan<K,V> ss, SkipList<K,V> sl)
    • killInstance

      public void killInstance()
    • flush

      public void flush()
      Specified by:
      flush in interface Flushable
    • print

      public String print()
    • printAll

      public String printAll()
    • getEnd

      public SkipSpan<K,V> getEnd()
    • getSpan

      public SkipSpan<K,V> getSpan(int start, K key, int[] search)
    • key

      public K key()
    • get

      public V get(int start, K key)
    • remove

      public Object[] remove(int start, 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 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

      public SkipLevels<K,V> put(int start, K key, V val, SkipList<K,V> sl)
      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

      public boolean blvlck(boolean fix, int width, SkipLevels<K,V>[] prevLevels)