@Immutable public class ImmutableTreeMap<K,V> extends AbstractImmutableSortedMap<K,V>
| Constructor and Description |
|---|
ImmutableTreeMap(java.util.SortedMap<K,V> sortedMap) |
| Modifier and Type | Method and Description |
|---|---|
java.util.Comparator<? super K> |
comparator() |
boolean |
containsKey(java.lang.Object key) |
boolean |
containsValue(java.lang.Object value) |
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> procedure)
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(). |
java.util.Set<K> |
keySet() |
com.gs.collections.api.RichIterable<K> |
keysView()
Returns an unmodifiable lazy iterable wrapped around the keySet for the map
|
com.gs.collections.api.RichIterable<com.gs.collections.api.tuple.Pair<K,V>> |
keyValuesView()
Returns an unmodifiable lazy iterable of key/value pairs wrapped around the entrySet for the map
|
K |
lastKey() |
static <K,V> com.gs.collections.api.map.sorted.ImmutableSortedMap<K,V> |
newMap(java.util.SortedMap<K,V> sortedMap) |
int |
size()
Returns the number of items in this iterable.
|
java.lang.String |
toString()
Returns a string representation of this MapIterable.
|
java.util.Collection<V> |
values() |
com.gs.collections.api.RichIterable<V> |
valuesView()
Returns an unmodifiable lazy iterable wrapped around the values for the map
|
aggregateBy, aggregateInPlaceBy, castToSortedMap, clear, collect, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectIf, collectInt, collectLong, collectShort, collectValues, detect, entrySet, flatCollect, groupBy, groupByEach, headMap, iterator, newWithAllKeyValueArguments, newWithAllKeyValues, newWithKeyValue, newWithoutAllKeys, newWithoutKey, partition, put, putAll, reject, reject, remove, select, select, selectInstancesOf, subMap, tailMap, toSortedMap, zip, zipWithIndexallSatisfy, anySatisfy, appendString, appendString, appendString, asLazy, chunk, collect, collectIf, collectWith, contains, containsAll, containsAllArguments, containsAllIterable, count, detect, detectIfNone, 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, notEmpty, reject, rejectWith, select, selectWith, sumOfDouble, sumOfFloat, sumOfInt, sumOfLong, toArray, toArray, toBag, toList, toMap, toSet, toSortedList, toSortedList, toSortedListBy, toSortedMap, toSortedMap, toSortedSet, toSortedSet, toSortedSetBy, zip, zipWithIndexclone, finalize, getClass, notify, notifyAll, wait, wait, waitforEachKey, forEachValue, getIfAbsent, getIfAbsentValue, getIfAbsentWith, ifPresentApplyallSatisfy, anySatisfy, appendString, appendString, appendString, asLazy, chunk, collect, collectIf, collectWith, contains, containsAll, containsAllArguments, containsAllIterable, count, detect, detectIfNone, flatCollect, getFirst, getLast, groupBy, groupByEach, injectInto, injectInto, injectInto, injectInto, injectInto, isEmpty, makeString, makeString, makeString, max, max, maxBy, min, min, minBy, noneSatisfy, 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 static <K,V> com.gs.collections.api.map.sorted.ImmutableSortedMap<K,V> newMap(java.util.SortedMap<K,V> sortedMap)
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 java.lang.String toString()
com.gs.collections.api.map.MapIterableString.valueOf(Object).public int size()
com.gs.collections.api.RichIterablepublic boolean containsKey(java.lang.Object key)
Map.containsKey(Object)public boolean containsValue(java.lang.Object value)
Map.containsValue(Object)public V get(java.lang.Object key)
Map.get(Object)public void forEachKeyValue(com.gs.collections.api.block.procedure.Procedure2<? super K,? super V> procedure)
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.RichIterable<K> keysView()
com.gs.collections.api.map.MapIterablepublic com.gs.collections.api.RichIterable<V> valuesView()
com.gs.collections.api.map.MapIterablepublic com.gs.collections.api.RichIterable<com.gs.collections.api.tuple.Pair<K,V>> keyValuesView()
com.gs.collections.api.map.MapIterablepublic java.util.Comparator<? super K> comparator()
public K firstKey()
public K lastKey()
public java.util.Set<K> keySet()
public java.util.Collection<V> values()