@InterfaceAudience.Private public class CellSkipListSet extends Object implements NavigableSet<Cell>
Set
of Cell
s implemented on top of a
ConcurrentSkipListMap
. Works like a
ConcurrentSkipListSet
in all but one regard:
An add will overwrite if already an entry for the added key. In other words,
where CSLS does "Adds the specified element to this set if it is not already
present.", this implementation "Adds the specified element to this set EVEN
if it is already present overwriting what was there previous". The call to
add returns true if no value in the backing map or false if there was an
entry with same key (though value may be different).
Otherwise, has same attributes as ConcurrentSkipListSet: e.g. tolerant of concurrent get and set and won't throw ConcurrentModificationException when iterating.
public Cell ceiling(Cell e)
ceiling
in interface NavigableSet<Cell>
public Iterator<Cell> descendingIterator()
descendingIterator
in interface NavigableSet<Cell>
public NavigableSet<Cell> descendingSet()
descendingSet
in interface NavigableSet<Cell>
public Cell floor(Cell e)
floor
in interface NavigableSet<Cell>
public NavigableSet<Cell> headSet(Cell toElement, boolean inclusive)
headSet
in interface NavigableSet<Cell>
public Cell higher(Cell e)
higher
in interface NavigableSet<Cell>
public Cell lower(Cell e)
lower
in interface NavigableSet<Cell>
public Cell pollFirst()
pollFirst
in interface NavigableSet<Cell>
public Cell pollLast()
pollLast
in interface NavigableSet<Cell>
public NavigableSet<Cell> subSet(Cell fromElement, boolean fromInclusive, Cell toElement, boolean toInclusive)
subSet
in interface NavigableSet<Cell>
public NavigableSet<Cell> tailSet(Cell fromElement, boolean inclusive)
tailSet
in interface NavigableSet<Cell>
public Comparator<? super Cell> comparator()
comparator
in interface SortedSet<Cell>
public boolean add(Cell e)
public boolean addAll(Collection<? extends Cell> c)
public void clear()
public boolean contains(Object o)
public boolean containsAll(Collection<?> c)
containsAll
in interface Collection<Cell>
containsAll
in interface Set<Cell>
public boolean isEmpty()
public boolean remove(Object o)
public boolean removeAll(Collection<?> c)
public boolean retainAll(Collection<?> c)
public int size()
public Object[] toArray()
Copyright © 2007-2016 The Apache Software Foundation. All Rights Reserved.