net.metanotion.util.skiplist

## Class SkipLevels

- java.lang.Object
- - net.metanotion.util.skiplist.SkipLevels

- Direct Known Subclasses:
    BSkipLevels

      public class SkipLevels
      extends Object

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `SkipSpan` | `bottom`
    `SkipLevels[]` | `levels`
    `static int` | `MAX_SIZE` We can't have more than 2**32 pages

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `SkipLevels()`
    `` | `SkipLevels(int size, SkipSpan span)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `blvlck(boolean fix, int depth)`
    `void` | `flush()`
    `Object` | `get(int start, Comparable key)`
    `SkipSpan` | `getEnd()`
    `SkipSpan` | `getSpan(int start, Comparable key, int[] search)`
    `Comparable` | `key()`
    `void` | `killInstance()`
    `SkipLevels` | `newInstance(int levels, SkipSpan ss, SkipList sl)`
    `String` | `print()`
    `String` | `printAll()`
    `SkipLevels` | `put(int start, Comparable key, Object val, SkipList sl)`
    `Object[]` | `remove(int start, Comparable key, SkipList sl)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### MAX_SIZE

          public static final int MAX_SIZE

      We can't have more than 2**32 pages
      See Also:
        Constant Field Values

    - #### levels

          public SkipLevels[] levels

    - #### bottom

          public SkipSpan bottom

  - ### Constructor Detail

    - #### SkipLevels

          protected SkipLevels()

    - #### SkipLevels

          public SkipLevels(int size,
                    SkipSpan span)

  - ### Method Detail

    - #### newInstance

          public SkipLevels newInstance(int levels,
                               SkipSpan ss,
                               SkipList sl)

    - #### killInstance

          public void killInstance()

    - #### flush

          public void flush()

    - #### print

          public String print()

    - #### printAll

          public String printAll()

    - #### getEnd

          public SkipSpan getEnd()

    - #### getSpan

          public SkipSpan getSpan(int start,
                         Comparable key,
                         int[] search)

    - #### key

          public Comparable key()

    - #### get

          public Object get(int start,
                   Comparable key)

    - #### remove

          public Object[] remove(int start,
                        Comparable key,
                        SkipList 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 put(int start,
                       Comparable key,
                       Object val,
                       SkipList 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 void blvlck(boolean fix,
                    int depth)