@InterfaceAudience.Private public class KeyValueSkipListSet extends Object implements NavigableSet<KeyValue>
Set
of KeyValue
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 KeyValue ceiling(KeyValue e)
ceiling
in interface NavigableSet<KeyValue>
public Iterator<KeyValue> descendingIterator()
descendingIterator
in interface NavigableSet<KeyValue>
public NavigableSet<KeyValue> descendingSet()
descendingSet
in interface NavigableSet<KeyValue>
public KeyValue floor(KeyValue e)
floor
in interface NavigableSet<KeyValue>
public NavigableSet<KeyValue> headSet(KeyValue toElement, boolean inclusive)
headSet
in interface NavigableSet<KeyValue>
public KeyValue higher(KeyValue e)
higher
in interface NavigableSet<KeyValue>
public KeyValue lower(KeyValue e)
lower
in interface NavigableSet<KeyValue>
public KeyValue pollFirst()
pollFirst
in interface NavigableSet<KeyValue>
public KeyValue pollLast()
pollLast
in interface NavigableSet<KeyValue>
public NavigableSet<KeyValue> subSet(KeyValue fromElement, boolean fromInclusive, KeyValue toElement, boolean toInclusive)
subSet
in interface NavigableSet<KeyValue>
public NavigableSet<KeyValue> tailSet(KeyValue fromElement, boolean inclusive)
tailSet
in interface NavigableSet<KeyValue>
public Comparator<? super KeyValue> comparator()
comparator
in interface SortedSet<KeyValue>
public boolean add(KeyValue e)
public boolean addAll(Collection<? extends KeyValue> c)
public void clear()
public boolean contains(Object o)
public boolean containsAll(Collection<?> c)
containsAll
in interface Collection<KeyValue>
containsAll
in interface Set<KeyValue>
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 © 2014 The Apache Software Foundation. All rights reserved.