submap operations
represent a subrange of mappings of their underlying
maps. Instances of this class support all methods of their
underlying maps, differing in that mappings outside their range are
ignored, and attempts to add mappings outside their ranges result
in
. Instances of this class are
constructed only using the
methods of their underlying maps.
| Method from java.util.concurrent.ConcurrentSkipListMap$SubMap Detail: |
public Entry ceilingEntry(K key) {
return getNearEntry(key, (m.GT|m.EQ));
}
|
public K ceilingKey(K key) {
return getNearKey(key, (m.GT|m.EQ));
}
|
public void clear() {
for (ConcurrentSkipListMap.Node< K,V > n = loNode();
isBeforeEnd(n);
n = n.next) {
if (n.getValidValue() != null)
m.remove(n.key);
}
}
|
public Comparator comparator() {
Comparator< ? super K > cmp = m.comparator();
if (isDescending)
return Collections.reverseOrder(cmp);
else
return cmp;
}
|
public boolean containsKey(Object key) {
if (key == null) throw new NullPointerException();
K k = (K)key;
return inBounds(k) && m.containsKey(k);
}
|
public boolean containsValue(Object value) {
if (value == null)
throw new NullPointerException();
for (ConcurrentSkipListMap.Node< K,V > n = loNode();
isBeforeEnd(n);
n = n.next) {
V v = n.getValidValue();
if (v != null && value.equals(v))
return true;
}
return false;
}
|
public NavigableSet descendingKeySet() {
return descendingMap().navigableKeySet();
}
|
public ConcurrentSkipListMap.SubMap descendingMap() {
return new SubMap< K,V >(m, lo, loInclusive,
hi, hiInclusive, !isDescending);
}
|
Iterator entryIterator() {
return new SubMapEntryIterator();
}
|
public Set entrySet() {
Set< Map.Entry< K,V > > es = entrySetView;
return (es != null) ? es : (entrySetView = new EntrySet(this));
}
|
public Entry firstEntry() {
return isDescending? highestEntry() : lowestEntry();
}
|
public K firstKey() {
return isDescending? highestKey() : lowestKey();
}
|
public Entry floorEntry(K key) {
return getNearEntry(key, (m.LT|m.EQ));
}
|
public K floorKey(K key) {
return getNearKey(key, (m.LT|m.EQ));
}
|
public V get(Object key) {
if (key == null) throw new NullPointerException();
K k = (K)key;
return ((!inBounds(k)) ? null : m.get(k));
}
|
public ConcurrentSkipListMap.SubMap headMap(K toKey) {
return headMap(toKey, false);
}
|
public ConcurrentSkipListMap.SubMap headMap(K toKey,
boolean inclusive) {
if (toKey == null)
throw new NullPointerException();
return newSubMap(null, false, toKey, inclusive);
}
|
public Entry higherEntry(K key) {
return getNearEntry(key, (m.GT));
}
|
public K higherKey(K key) {
return getNearKey(key, (m.GT));
}
|
public boolean isEmpty() {
return !isBeforeEnd(loNode());
}
|
Iterator keyIterator() {
return new SubMapKeyIterator();
}
|
public NavigableSet keySet() {
KeySet< K > ks = keySetView;
return (ks != null) ? ks : (keySetView = new KeySet(this));
}
|
public Entry lastEntry() {
return isDescending? lowestEntry() : highestEntry();
}
|
public K lastKey() {
return isDescending? lowestKey() : highestKey();
}
|
public Entry lowerEntry(K key) {
return getNearEntry(key, (m.LT));
}
|
public K lowerKey(K key) {
return getNearKey(key, (m.LT));
}
|
public NavigableSet navigableKeySet() {
KeySet< K > ks = keySetView;
return (ks != null) ? ks : (keySetView = new KeySet(this));
}
|
public Entry pollFirstEntry() {
return isDescending? removeHighest() : removeLowest();
}
|
public Entry pollLastEntry() {
return isDescending? removeLowest() : removeHighest();
}
|
public V put(K key,
V value) {
checkKeyBounds(key);
return m.put(key, value);
}
|
public V putIfAbsent(K key,
V value) {
checkKeyBounds(key);
return m.putIfAbsent(key, value);
}
|
public V remove(Object key) {
K k = (K)key;
return (!inBounds(k))? null : m.remove(k);
}
|
public boolean remove(Object key,
Object value) {
K k = (K)key;
return inBounds(k) && m.remove(k, value);
}
|
public V replace(K key,
V value) {
checkKeyBounds(key);
return m.replace(key, value);
}
|
public boolean replace(K key,
V oldValue,
V newValue) {
checkKeyBounds(key);
return m.replace(key, oldValue, newValue);
}
|
public int size() {
long count = 0;
for (ConcurrentSkipListMap.Node< K,V > n = loNode();
isBeforeEnd(n);
n = n.next) {
if (n.getValidValue() != null)
++count;
}
return count >= Integer.MAX_VALUE? Integer.MAX_VALUE : (int)count;
}
|
public ConcurrentSkipListMap.SubMap subMap(K fromKey,
K toKey) {
return subMap(fromKey, true, toKey, false);
}
|
public ConcurrentSkipListMap.SubMap subMap(K fromKey,
boolean fromInclusive,
K toKey,
boolean toInclusive) {
if (fromKey == null || toKey == null)
throw new NullPointerException();
return newSubMap(fromKey, fromInclusive, toKey, toInclusive);
}
|
public ConcurrentSkipListMap.SubMap tailMap(K fromKey) {
return tailMap(fromKey, true);
}
|
public ConcurrentSkipListMap.SubMap tailMap(K fromKey,
boolean inclusive) {
if (fromKey == null)
throw new NullPointerException();
return newSubMap(fromKey, inclusive, null, false);
}
|
Iterator valueIterator() {
return new SubMapValueIterator();
}
|
public Collection values() {
Collection< V > vs = valuesView;
return (vs != null) ? vs : (valuesView = new Values(this));
}
|