public final class TreeSortedMap<K,V> extends AbstractMutableSortedMap<K,V> implements java.io.Externalizable
| Constructor and Description |
|---|
TreeSortedMap() |
TreeSortedMap(java.util.Comparator<? super K> comparator) |
TreeSortedMap(java.util.Comparator<? super K> comparator,
java.util.Map<? extends K,? extends V> map) |
TreeSortedMap(java.util.Map<? extends K,? extends V> map) |
TreeSortedMap(com.gs.collections.api.tuple.Pair<K,V>... pairs) |
TreeSortedMap(java.util.SortedMap<K,? extends V> map) |
| Modifier and Type | Method and Description |
|---|---|
void |
clear() |
TreeSortedMap<K,V> |
clone() |
java.util.Comparator<? super K> |
comparator() |
boolean |
containsKey(java.lang.Object key) |
boolean |
containsValue(java.lang.Object value) |
com.gs.collections.api.set.MutableSet<java.util.Map.Entry<K,V>> |
entrySet() |
boolean |
equals(java.lang.Object o)
Follows the same general contract as
Map.equals(Object). |
K |
firstKey() |
void |
forEachKeyValue(com.gs.collections.api.block.procedure.Procedure2<? super K,? super V> procedure2)
Calls the
procedure with each key-value pair of the map. |
V |
get(java.lang.Object key) |
int |
hashCode()
Follows the same general contract as
Map.hashCode(). |
com.gs.collections.api.map.sorted.MutableSortedMap<K,V> |
headMap(K toKey) |
com.gs.collections.api.set.MutableSet<K> |
keySet()
The underlying set for the keys is sorted in ascending order according to their natural ordering or a custom comparator.
|
K |
lastKey() |
com.gs.collections.api.map.sorted.MutableSortedMap<K,V> |
newEmpty()
Creates a new instance of the same type with the same internal Comparator.
|
static <K,V> TreeSortedMap<K,V> |
newMap() |
static <K,V> TreeSortedMap<K,V> |
newMap(java.util.Comparator<? super K> comparator) |
static <K,V> TreeSortedMap<K,V> |
newMap(java.util.Comparator<? super K> comparator,
java.util.Map<? extends K,? extends V> map) |
static <K,V> TreeSortedMap<K,V> |
newMap(java.util.Map<? extends K,? extends V> map) |
static <K,V> TreeSortedMap<K,V> |
newMapWith(java.util.Comparator<? super K> comparator,
K key,
V value) |
static <K,V> TreeSortedMap<K,V> |
newMapWith(java.util.Comparator<? super K> comparator,
K key1,
V value1,
K key2,
V value2) |
static <K,V> TreeSortedMap<K,V> |
newMapWith(java.util.Comparator<? super K> comparator,
K key1,
V value1,
K key2,
V value2,
K key3,
V value3) |
static <K,V> TreeSortedMap<K,V> |
newMapWith(java.util.Comparator<? super K> comparator,
K key1,
V value1,
K key2,
V value2,
K key3,
V value3,
K key4,
V value4) |
static <K,V> TreeSortedMap<K,V> |
newMapWith(java.util.Comparator<? super K> comparator,
com.gs.collections.api.tuple.Pair<K,V>... pairs) |
static <K,V> TreeSortedMap<K,V> |
newMapWith(K key,
V value) |
static <K,V> TreeSortedMap<K,V> |
newMapWith(K key1,
V value1,
K key2,
V value2) |
static <K,V> TreeSortedMap<K,V> |
newMapWith(K key1,
V value1,
K key2,
V value2,
K key3,
V value3) |
static <K,V> TreeSortedMap<K,V> |
newMapWith(K key1,
V value1,
K key2,
V value2,
K key3,
V value3,
K key4,
V value4) |
static <K,V> TreeSortedMap<K,V> |
newMapWith(com.gs.collections.api.tuple.Pair<K,V>... pairs) |
V |
put(K key,
V value) |
void |
putAll(java.util.Map<? extends K,? extends V> map) |
void |
readExternal(java.io.ObjectInput in) |
V |
remove(java.lang.Object key) |
V |
removeKey(K key)
Remove an entry from the map at the specified
key. |
int |
size()
Returns the number of items in this iterable.
|
com.gs.collections.api.map.sorted.MutableSortedMap<K,V> |
subMap(K fromKey,
K toKey) |
com.gs.collections.api.map.sorted.MutableSortedMap<K,V> |
tailMap(K fromKey) |
java.lang.String |
toString()
Returns a string representation of this MapIterable.
|
com.gs.collections.api.collection.MutableCollection<V> |
values() |
TreeSortedMap<K,V> |
with(K key,
V value) |
TreeSortedMap<K,V> |
with(K key1,
V value1,
K key2,
V value2) |
TreeSortedMap<K,V> |
with(K key1,
V value1,
K key2,
V value2,
K key3,
V value3) |
TreeSortedMap<K,V> |
with(K key1,
V value1,
K key2,
V value2,
K key3,
V value3,
K key4,
V value4) |
TreeSortedMap<K,V> |
with(com.gs.collections.api.tuple.Pair<K,V>... pairs) |
void |
writeExternal(java.io.ObjectOutput out) |
aggregateBy, aggregateInPlaceBy, asSynchronized, asUnmodifiable, collect, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectIf, collectInt, collectKeysAndValues, collectLong, collectShort, collectValues, collectWith, detect, flatCollect, flip, flipUniqueValues, getIfAbsentPut, getIfAbsentPutWith, getIfAbsentPutWithKey, groupBy, groupByEach, groupByUniqueKey, iterator, keysView, keyValuesView, partition, partitionWith, reject, reject, rejectWith, select, select, selectInstancesOf, selectWith, toImmutable, valuesView, zip, zipWithIndexallSatisfy, allSatisfyWith, anySatisfy, anySatisfyWith, appendString, appendString, appendString, asLazy, chunk, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectIf, collectInt, collectLong, collectShort, collectWith, contains, containsAll, containsAllArguments, containsAllIterable, count, countWith, detect, detectIfNone, detectWith, detectWithIfNone, flatCollect, forEach, forEachKey, forEachValue, forEachWith, forEachWithIndex, getFirst, getIfAbsent, getIfAbsentValue, getIfAbsentWith, getLast, groupBy, groupByEach, ifPresentApply, injectInto, injectInto, injectInto, injectInto, injectInto, isAbsent, isEmpty, keyAndValueEquals, keyAndValueHashCode, makeString, makeString, makeString, max, max, maxBy, min, min, minBy, noneSatisfy, noneSatisfyWith, notEmpty, reject, rejectWith, select, selectWith, sumOfDouble, sumOfFloat, sumOfInt, sumOfLong, toArray, toArray, toBag, toList, toMap, toSet, toSortedList, toSortedList, toSortedListBy, toSortedMap, toSortedMap, toSortedSet, toSortedSet, toSortedSetBy, zip, zipWithIndexfinalize, getClass, notify, notifyAll, wait, wait, waitforEachKey, forEachValue, getIfAbsent, getIfAbsentValue, getIfAbsentWith, ifPresentApplyallSatisfy, allSatisfyWith, anySatisfy, anySatisfyWith, appendString, appendString, appendString, asLazy, chunk, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectIf, collectInt, collectLong, collectShort, collectWith, contains, containsAll, containsAllArguments, containsAllIterable, count, countWith, detect, detectIfNone, detectWith, detectWithIfNone, flatCollect, getFirst, getLast, groupBy, groupByEach, injectInto, injectInto, injectInto, injectInto, injectInto, isEmpty, makeString, makeString, makeString, max, max, maxBy, min, min, minBy, noneSatisfy, noneSatisfyWith, notEmpty, reject, rejectWith, select, selectWith, sumOfDouble, sumOfFloat, sumOfInt, sumOfLong, toArray, toArray, toBag, toList, toMap, toSet, toSortedList, toSortedList, toSortedListBy, toSortedMap, toSortedMap, toSortedSet, toSortedSet, toSortedSetBy, zip, zipWithIndexpublic TreeSortedMap()
public TreeSortedMap(java.util.Comparator<? super K> comparator)
public TreeSortedMap(java.util.Comparator<? super K> comparator, java.util.Map<? extends K,? extends V> map)
public static <K,V> TreeSortedMap<K,V> newMap()
public static <K,V> TreeSortedMap<K,V> newMap(java.util.Comparator<? super K> comparator)
public static <K,V> TreeSortedMap<K,V> newMap(java.util.Map<? extends K,? extends V> map)
public static <K,V> TreeSortedMap<K,V> newMap(java.util.Comparator<? super K> comparator, java.util.Map<? extends K,? extends V> map)
public static <K,V> TreeSortedMap<K,V> newMapWith(com.gs.collections.api.tuple.Pair<K,V>... pairs)
public static <K,V> TreeSortedMap<K,V> newMapWith(java.util.Comparator<? super K> comparator, com.gs.collections.api.tuple.Pair<K,V>... pairs)
public static <K,V> TreeSortedMap<K,V> newMapWith(K key, V value)
public static <K,V> TreeSortedMap<K,V> newMapWith(K key1, V value1, K key2, V value2)
public static <K,V> TreeSortedMap<K,V> newMapWith(K key1, V value1, K key2, V value2, K key3, V value3)
public static <K,V> TreeSortedMap<K,V> newMapWith(K key1, V value1, K key2, V value2, K key3, V value3, K key4, V value4)
public static <K,V> TreeSortedMap<K,V> newMapWith(java.util.Comparator<? super K> comparator, K key, V value)
public static <K,V> TreeSortedMap<K,V> newMapWith(java.util.Comparator<? super K> comparator, K key1, V value1, K key2, V value2)
public static <K,V> TreeSortedMap<K,V> newMapWith(java.util.Comparator<? super K> comparator, K key1, V value1, K key2, V value2, K key3, V value3)
public static <K,V> TreeSortedMap<K,V> newMapWith(java.util.Comparator<? super K> comparator, K key1, V value1, K key2, V value2, K key3, V value3, K key4, V value4)
public TreeSortedMap<K,V> with(K key, V value)
public TreeSortedMap<K,V> with(K key1, V value1, K key2, V value2, K key3, V value3, K key4, V value4)
public TreeSortedMap<K,V> with(com.gs.collections.api.tuple.Pair<K,V>... pairs)
public int size()
com.gs.collections.api.RichIterablepublic com.gs.collections.api.map.sorted.MutableSortedMap<K,V> newEmpty()
com.gs.collections.api.map.sorted.MutableSortedMappublic V removeKey(K key)
com.gs.collections.api.map.sorted.MutableSortedMapkey.public TreeSortedMap<K,V> clone()
public boolean equals(java.lang.Object o)
com.gs.collections.api.map.MapIterableMap.equals(Object).public int hashCode()
com.gs.collections.api.map.MapIterableMap.hashCode().public void forEachKeyValue(com.gs.collections.api.block.procedure.Procedure2<? super K,? super V> procedure2)
com.gs.collections.api.map.MapIterableprocedure with each key-value pair of the map.
final Collection<String> collection = new ArrayList<String>();
MutableMap<Integer, String> map = this.newMapWithKeysValues(1, "One", 2, "Two", 3, "Three");
map.forEachKeyValue(new Procedure2<Integer, String>()
{
public void value(final Integer key, final String value)
{
collection.add(String.valueOf(key) + value);
}
});
Verify.assertContainsAll(collection, "1One", "2Two", "3Three");
public com.gs.collections.api.set.MutableSet<K> keySet()
com.gs.collections.api.map.sorted.MutableSortedMappublic com.gs.collections.api.collection.MutableCollection<V> values()
public java.util.Comparator<? super K> comparator()
public V get(java.lang.Object key)
public boolean containsKey(java.lang.Object key)
public boolean containsValue(java.lang.Object value)
public java.lang.String toString()
com.gs.collections.api.map.MapIterableString.valueOf(Object).public void writeExternal(java.io.ObjectOutput out)
throws java.io.IOException
writeExternal in interface java.io.Externalizablejava.io.IOExceptionpublic void readExternal(java.io.ObjectInput in)
throws java.io.IOException,
java.lang.ClassNotFoundException
readExternal in interface java.io.Externalizablejava.io.IOExceptionjava.lang.ClassNotFoundException