org.apache.cassandra.utils.btree

## Class BTreeSet<V>

- java.lang.Object
- - org.apache.cassandra.utils.btree.BTreeSet<V>

All Implemented Interfaces:
  java.lang.Iterable<V>, java.util.Collection<V>, java.util.NavigableSet<V>, java.util.Set<V>, java.util.SortedSet<V>

Direct Known Subclasses:
  BTreeSet.BTreeRange

    public class BTreeSet<V>
    extends java.lang.Object
    implements java.util.NavigableSet<V>

### Nested Class Summary

Nested Classes
`static class` `BTreeSet.BTreeDescRange<V>`
`static class` `BTreeSet.BTreeRange<V>`

### Field Summary

Fields
`protected java.util.Comparator<V>` `comparator`
`protected java.lang.Object[]` `tree`

### Constructor Summary

Constructors
Constructor and Description
`BTreeSet(java.lang.Object[] tree, java.util.Comparator<V> comparator)`

### Method Summary

All Methods Instance Methods Concrete Methods
`boolean` `add(V v)`
`boolean` `addAll(java.util.Collection<? extends V> c)`
`V` `ceiling(V v)`
`void` `clear()`
`java.util.Comparator<? super V>` `comparator()`
`boolean` `contains(java.lang.Object o)`
`boolean` `containsAll(java.util.Collection<?> c)`
`java.util.Iterator<V>` `descendingIterator()`
`java.util.NavigableSet<V>` `descendingSet()`
`V` `first()`
`V` `floor(V v)`
`java.util.SortedSet<V>` `headSet(V toElement)`
`java.util.NavigableSet<V>` `headSet(V toElement, boolean inclusive)`
`V` `higher(V v)`
`boolean` `isEmpty()`
`java.util.Iterator<V>` `iterator()`
`V` `last()`
`V` `lower(V v)`
`V` `pollFirst()`
`V` `pollLast()`
`boolean` `remove(java.lang.Object o)`
`boolean` `removeAll(java.util.Collection<?> c)`
`boolean` `retainAll(java.util.Collection<?> c)`
`int` `size()`
`protected Cursor<V,V>` `slice(boolean forwards, boolean permitInversion)`
`java.util.NavigableSet<V>` `subSet(V fromElement, boolean fromInclusive, V toElement, boolean toInclusive)`
`java.util.SortedSet<V>` `subSet(V fromElement, V toElement)`
`java.util.SortedSet<V>` `tailSet(V fromElement)`
`java.util.NavigableSet<V>` `tailSet(V fromElement, boolean inclusive)`
`java.lang.Object[]` `toArray()`
`<T> T[]` `toArray(T[] a)`
`BTreeSet<V>` `update(java.util.Collection<V> updateWith, boolean isSorted)`

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

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

### Methods inherited from interface java.util.SortedSet

`spliterator`

### Methods inherited from interface java.util.Set

`equals, hashCode`

### Methods inherited from interface java.util.Collection

`parallelStream, removeIf, stream`

### Methods inherited from interface java.lang.Iterable

`forEach`

### Field Detail

#### comparator

    protected final java.util.Comparator<V> comparator

#### tree

    protected final java.lang.Object[] tree

### Constructor Detail

#### BTreeSet

    public BTreeSet(java.lang.Object[] tree,
                    java.util.Comparator<V> comparator)

### Method Detail

#### update

    public BTreeSet<V> update(java.util.Collection<V> updateWith,
                              boolean isSorted)

#### comparator

    public java.util.Comparator<? super V> comparator()

Specified by:
  `comparator` in interface `java.util.SortedSet<V>`

#### slice

    protected Cursor<V,V> slice(boolean forwards,
                                boolean permitInversion)

#### size

    public int size()

Specified by:
  `size` in interface `java.util.Collection<V>`
Specified by:
  `size` in interface `java.util.Set<V>`

#### isEmpty

    public boolean isEmpty()

Specified by:
  `isEmpty` in interface `java.util.Collection<V>`
Specified by:
  `isEmpty` in interface `java.util.Set<V>`

#### iterator

    public java.util.Iterator<V> iterator()

Specified by:
  `iterator` in interface `java.lang.Iterable<V>`
Specified by:
  `iterator` in interface `java.util.Collection<V>`
Specified by:
  `iterator` in interface `java.util.NavigableSet<V>`
Specified by:
  `iterator` in interface `java.util.Set<V>`

#### descendingIterator

    public java.util.Iterator<V> descendingIterator()

Specified by:
  `descendingIterator` in interface `java.util.NavigableSet<V>`

#### toArray

    public java.lang.Object[] toArray()

Specified by:
  `toArray` in interface `java.util.Collection<V>`
Specified by:
  `toArray` in interface `java.util.Set<V>`

#### toArray

    public <T> T[] toArray(T[] a)

Specified by:
  `toArray` in interface `java.util.Collection<V>`
Specified by:
  `toArray` in interface `java.util.Set<V>`

#### subSet

    public java.util.NavigableSet<V> subSet(V fromElement,
                                            boolean fromInclusive,
                                            V toElement,
                                            boolean toInclusive)

Specified by:
  `subSet` in interface `java.util.NavigableSet<V>`

#### headSet

    public java.util.NavigableSet<V> headSet(V toElement,
                                             boolean inclusive)

Specified by:
  `headSet` in interface `java.util.NavigableSet<V>`

#### tailSet

    public java.util.NavigableSet<V> tailSet(V fromElement,
                                             boolean inclusive)

Specified by:
  `tailSet` in interface `java.util.NavigableSet<V>`

#### subSet

    public java.util.SortedSet<V> subSet(V fromElement,
                                         V toElement)

Specified by:
  `subSet` in interface `java.util.NavigableSet<V>`
Specified by:
  `subSet` in interface `java.util.SortedSet<V>`

#### headSet

    public java.util.SortedSet<V> headSet(V toElement)

Specified by:
  `headSet` in interface `java.util.NavigableSet<V>`
Specified by:
  `headSet` in interface `java.util.SortedSet<V>`

#### tailSet

    public java.util.SortedSet<V> tailSet(V fromElement)

Specified by:
  `tailSet` in interface `java.util.NavigableSet<V>`
Specified by:
  `tailSet` in interface `java.util.SortedSet<V>`

#### first

    public V first()

Specified by:
  `first` in interface `java.util.SortedSet<V>`

#### last

    public V last()

Specified by:
  `last` in interface `java.util.SortedSet<V>`

#### addAll

    public boolean addAll(java.util.Collection<? extends V> c)

Specified by:
  `addAll` in interface `java.util.Collection<V>`
Specified by:
  `addAll` in interface `java.util.Set<V>`

#### retainAll

    public boolean retainAll(java.util.Collection<?> c)

Specified by:
  `retainAll` in interface `java.util.Collection<V>`
Specified by:
  `retainAll` in interface `java.util.Set<V>`

#### removeAll

    public boolean removeAll(java.util.Collection<?> c)

Specified by:
  `removeAll` in interface `java.util.Collection<V>`
Specified by:
  `removeAll` in interface `java.util.Set<V>`

#### clear

    public void clear()

Specified by:
  `clear` in interface `java.util.Collection<V>`
Specified by:
  `clear` in interface `java.util.Set<V>`

#### pollFirst

    public V pollFirst()

Specified by:
  `pollFirst` in interface `java.util.NavigableSet<V>`

#### pollLast

    public V pollLast()

Specified by:
  `pollLast` in interface `java.util.NavigableSet<V>`

#### add

    public boolean add(V v)

Specified by:
  `add` in interface `java.util.Collection<V>`
Specified by:
  `add` in interface `java.util.Set<V>`

#### remove

    public boolean remove(java.lang.Object o)

Specified by:
  `remove` in interface `java.util.Collection<V>`
Specified by:
  `remove` in interface `java.util.Set<V>`

#### lower

    public V lower(V v)

Specified by:
  `lower` in interface `java.util.NavigableSet<V>`

#### floor

    public V floor(V v)

Specified by:
  `floor` in interface `java.util.NavigableSet<V>`

#### ceiling

    public V ceiling(V v)

Specified by:
  `ceiling` in interface `java.util.NavigableSet<V>`

#### higher

    public V higher(V v)

Specified by:
  `higher` in interface `java.util.NavigableSet<V>`

#### contains

    public boolean contains(java.lang.Object o)

Specified by:
  `contains` in interface `java.util.Collection<V>`
Specified by:
  `contains` in interface `java.util.Set<V>`

#### containsAll

    public boolean containsAll(java.util.Collection<?> c)

Specified by:
  `containsAll` in interface `java.util.Collection<V>`
Specified by:
  `containsAll` in interface `java.util.Set<V>`

#### descendingSet

    public java.util.NavigableSet<V> descendingSet()

Specified by:
  `descendingSet` in interface `java.util.NavigableSet<V>`