Class TreeSortedMap<K,V>
- java.lang.Object
-
- org.eclipse.collections.impl.AbstractRichIterable<V>
-
- org.eclipse.collections.impl.map.AbstractMapIterable<K,V>
-
- org.eclipse.collections.impl.map.mutable.AbstractMutableMapIterable<K,V>
-
- org.eclipse.collections.impl.map.sorted.mutable.AbstractMutableSortedMap<K,V>
-
- org.eclipse.collections.impl.map.sorted.mutable.TreeSortedMap<K,V>
-
- All Implemented Interfaces:
Externalizable,Serializable,Cloneable,Iterable<V>,Map<K,V>,SortedMap<K,V>,InternalIterable<V>,MapIterable<K,V>,MutableMapIterable<K,V>,MutableSortedMap<K,V>,SortedMapIterable<K,V>,OrderedIterable<V>,ReversibleIterable<V>,RichIterable<V>
public class TreeSortedMap<K,V> extends AbstractMutableSortedMap<K,V> implements Externalizable
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description TreeSortedMap()TreeSortedMap(Comparator<? super K> comparator)TreeSortedMap(Comparator<? super K> comparator, Map<? extends K,? extends V> map)TreeSortedMap(Map<? extends K,? extends V> map)TreeSortedMap(SortedMap<K,? extends V> map)TreeSortedMap(Pair<K,V>... pairs)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()TreeSortedMap<K,V>clone()Comparator<? super K>comparator()booleancontainsKey(Object key)booleancontainsValue(Object value)MutableList<V>distinct()MutableSortedMap<K,V>drop(int count)MutableSortedMap<K,V>dropWhile(Predicate<? super V> predicate)MutableSet<Map.Entry<K,V>>entrySet()booleanequals(Object o)KfirstKey()voidforEachKeyValue(Procedure2<? super K,? super V> procedure2)Vget(Object key)inthashCode()MutableSortedMap<K,V>headMap(K toKey)MutableSet<K>keySet()KlastKey()MutableSortedMap<K,V>newEmpty()static <K,V>
TreeSortedMap<K,V>newMap()static <K,V>
TreeSortedMap<K,V>newMap(Comparator<? super K> comparator)static <K,V>
TreeSortedMap<K,V>newMap(Comparator<? super K> comparator, Map<? extends K,? extends V> map)static <K,V>
TreeSortedMap<K,V>newMap(Map<? extends K,? extends V> map)static <K,V>
TreeSortedMap<K,V>newMapWith(Comparator<? super K> comparator, K key, V value)static <K,V>
TreeSortedMap<K,V>newMapWith(Comparator<? super K> comparator, K key1, V value1, K key2, V value2)static <K,V>
TreeSortedMap<K,V>newMapWith(Comparator<? super K> comparator, K key1, V value1, K key2, V value2, K key3, V value3)static <K,V>
TreeSortedMap<K,V>newMapWith(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(Comparator<? super K> comparator, 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(Pair<K,V>... pairs)PartitionMutableList<V>partitionWhile(Predicate<? super V> predicate)Vput(K key, V value)voidputAll(Map<? extends K,? extends V> map)voidreadExternal(ObjectInput in)Vremove(Object key)VremoveKey(K key)intsize()MutableSortedMap<K,V>subMap(K fromKey, K toKey)MutableSortedMap<K,V>tailMap(K fromKey)MutableSortedMap<K,V>take(int count)MutableSortedMap<K,V>takeWhile(Predicate<? super V> predicate)MutableSortedMap<K,V>toReversed()StringtoString()Returns a string with the elements of the iterable separated by commas with spaces and enclosed in square brackets.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(Pair<K,V>... pairs)voidwriteExternal(ObjectOutput out)-
Methods inherited from class org.eclipse.collections.impl.map.sorted.mutable.AbstractMutableSortedMap
asSynchronized, asUnmodifiable, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectIf, collectInt, collectKeysAndValues, collectLong, collectShort, collectValues, collectWith, corresponds, detectIndex, detectLastIndex, flatCollect, flip, forEach, forEachWithIndex, groupBy, groupByEach, groupByUniqueKey, partition, partitionWith, reject, reject, rejectWith, select, select, selectInstancesOf, selectWith, tap, toImmutable, toStack, withAllKeyValueArguments, withAllKeyValues, withKeyValue, withoutAllKeys, withoutKey, zip, zipWithIndex
-
Methods inherited from class org.eclipse.collections.impl.map.mutable.AbstractMutableMapIterable
aggregateBy, collect, countBy, countByEach, countByWith, detect, detectOptional, flipUniqueValues, getIfAbsentPut, getIfAbsentPut, getIfAbsentPutWith, getIfAbsentPutWithKey, iterator, keysView, keyValuesView, sumByDouble, sumByFloat, sumByInt, sumByLong, updateValue, updateValueWith, valuesView
-
Methods inherited from class org.eclipse.collections.impl.map.AbstractMapIterable
allSatisfy, allSatisfyWith, anySatisfy, anySatisfyWith, asLazy, chunk, contains, detect, detectIfNone, detectOptional, detectWith, detectWithIfNone, detectWithOptional, each, forEachKey, forEachValue, forEachWith, forEachWithIndex, getFirst, getIfAbsent, getIfAbsentValue, getIfAbsentWith, getLast, getOnly, getOrDefault, ifPresentApply, noneSatisfy, noneSatisfyWith, toArray, toArray
-
Methods inherited from class org.eclipse.collections.impl.AbstractRichIterable
appendString, appendString, collect, collectIf, collectWith, containsAll, containsAllArguments, containsAllIterable, count, countWith, flatCollect, forEach, groupBy, groupByEach, groupByUniqueKey, injectInto, injectInto, injectInto, injectInto, injectInto, into, isEmpty, max, max, maxBy, min, min, minBy, reject, rejectWith, select, selectWith, sumOfDouble, sumOfFloat, sumOfInt, sumOfLong, toBag, toBiMap, toList, toMap, toSet, toSortedBag, toSortedBag, toSortedBagBy, toSortedListBy, toSortedMap, toSortedMap, toSortedMapBy, toSortedSet, toSortedSet, toSortedSetBy, zip, zipWithIndex
-
Methods inherited from interface org.eclipse.collections.api.InternalIterable
forEach, forEachWith
-
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, isEmpty, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Methods inherited from interface org.eclipse.collections.api.map.MapIterable
detect, detectOptional, forEachKey, forEachValue, getIfAbsent, getIfAbsentValue, getIfAbsentWith, ifPresentApply, injectIntoKeyValue, keysView, keyValuesView, parallelStream, spliterator, stream, valuesView
-
Methods inherited from interface org.eclipse.collections.api.map.MutableMapIterable
add, aggregateBy, aggregateBy, aggregateInPlaceBy, countBy, countByEach, countByWith, flipUniqueValues, forEach, getIfAbsentPut, getIfAbsentPut, getIfAbsentPutWithKey, getOrDefault, putAllMapIterable, putPair, removeAllKeys, removeIf, sumByDouble, sumByFloat, sumByInt, sumByLong, updateValue, updateValueWith
-
Methods inherited from interface org.eclipse.collections.api.map.sorted.MutableSortedMap
collect, collectWithIndex, flatCollectWith, getIfAbsentPutWith, withMap, withMapIterable
-
Methods inherited from interface org.eclipse.collections.api.ordered.OrderedIterable
collectWithIndex, forEachWithIndex, getFirst, getFirstOptional, getLast, getLastOptional, indexOf, max, min, rejectWithIndex, selectWithIndex, zip, zipWithIndex
-
Methods inherited from interface org.eclipse.collections.api.ordered.ReversibleIterable
asReversed, reverseForEach, reverseForEachWithIndex
-
Methods inherited from interface org.eclipse.collections.api.RichIterable
aggregateBy, allSatisfy, allSatisfyWith, anySatisfy, anySatisfyWith, appendString, appendString, appendString, asLazy, chunk, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectIf, collectInt, collectLong, collectShort, collectWith, contains, containsAll, containsAllArguments, containsAllIterable, containsAny, containsAnyIterable, containsBy, containsNone, containsNoneIterable, count, countBy, countByEach, countByWith, countWith, detect, detectIfNone, detectOptional, detectWith, detectWithIfNone, detectWithOptional, each, flatCollect, flatCollectBoolean, flatCollectByte, flatCollectChar, flatCollectDouble, flatCollectFloat, flatCollectInt, flatCollectLong, flatCollectShort, flatCollectWith, forEach, getAny, getOnly, groupBy, groupByAndCollect, groupByEach, groupByUniqueKey, injectInto, injectInto, injectInto, injectInto, injectInto, injectIntoDouble, injectIntoFloat, injectIntoInt, injectIntoLong, into, isEmpty, makeString, makeString, makeString, makeString, max, maxBy, maxByOptional, maxOptional, maxOptional, min, minBy, minByOptional, minOptional, minOptional, noneSatisfy, noneSatisfyWith, notEmpty, reduce, reduceInPlace, reduceInPlace, reject, rejectWith, select, selectWith, summarizeDouble, summarizeFloat, summarizeInt, summarizeLong, sumOfDouble, sumOfFloat, sumOfInt, sumOfLong, toArray, toArray, toBag, toBiMap, toImmutableBag, toImmutableBiMap, toImmutableList, toImmutableMap, toImmutableSet, toImmutableSortedBag, toImmutableSortedBag, toImmutableSortedBagBy, toImmutableSortedList, toImmutableSortedList, toImmutableSortedListBy, toImmutableSortedSet, toImmutableSortedSet, toImmutableSortedSetBy, toList, toMap, toMap, toSet, toSortedBag, toSortedBag, toSortedBagBy, toSortedList, toSortedList, toSortedListBy, toSortedMap, toSortedMap, toSortedMapBy, toSortedSet, toSortedSet, toSortedSetBy
-
-
-
-
Constructor Detail
-
TreeSortedMap
public TreeSortedMap()
-
TreeSortedMap
public TreeSortedMap(Comparator<? super K> comparator)
-
TreeSortedMap
public TreeSortedMap(Comparator<? super K> comparator, Map<? extends K,? extends V> map)
-
-
Method Detail
-
newMap
public static <K,V> TreeSortedMap<K,V> newMap()
-
newMap
public static <K,V> TreeSortedMap<K,V> newMap(Comparator<? super K> comparator)
-
newMap
public static <K,V> TreeSortedMap<K,V> newMap(Map<? extends K,? extends V> map)
-
newMap
public static <K,V> TreeSortedMap<K,V> newMap(Comparator<? super K> comparator, Map<? extends K,? extends V> map)
-
newMapWith
public static <K,V> TreeSortedMap<K,V> newMapWith(Pair<K,V>... pairs)
-
newMapWith
public static <K,V> TreeSortedMap<K,V> newMapWith(Comparator<? super K> comparator, Pair<K,V>... pairs)
-
newMapWith
public static <K,V> TreeSortedMap<K,V> newMapWith(K key, V value)
-
newMapWith
public static <K,V> TreeSortedMap<K,V> newMapWith(K key1, V value1, K key2, V value2)
-
newMapWith
public static <K,V> TreeSortedMap<K,V> newMapWith(K key1, V value1, K key2, V value2, K key3, V value3)
-
newMapWith
public static <K,V> TreeSortedMap<K,V> newMapWith(K key1, V value1, K key2, V value2, K key3, V value3, K key4, V value4)
-
newMapWith
public static <K,V> TreeSortedMap<K,V> newMapWith(Comparator<? super K> comparator, K key, V value)
-
newMapWith
public static <K,V> TreeSortedMap<K,V> newMapWith(Comparator<? super K> comparator, K key1, V value1, K key2, V value2)
-
newMapWith
public static <K,V> TreeSortedMap<K,V> newMapWith(Comparator<? super K> comparator, K key1, V value1, K key2, V value2, K key3, V value3)
-
newMapWith
public static <K,V> TreeSortedMap<K,V> newMapWith(Comparator<? super K> comparator, K key1, V value1, K key2, V value2, K key3, V value3, K key4, V value4)
-
with
public TreeSortedMap<K,V> with(K key, V value)
-
with
public TreeSortedMap<K,V> with(K key1, V value1, K key2, V value2, K key3, V value3, K key4, V value4)
-
with
public TreeSortedMap<K,V> with(Pair<K,V>... pairs)
- Specified by:
within interfaceMutableSortedMap<K,V>
-
size
public int size()
-
newEmpty
public MutableSortedMap<K,V> newEmpty()
- Specified by:
newEmptyin interfaceMutableMapIterable<K,V>- Specified by:
newEmptyin interfaceMutableSortedMap<K,V>
-
clone
public TreeSortedMap<K,V> clone()
- Specified by:
clonein interfaceMutableSortedMap<K,V>- Specified by:
clonein classAbstractMutableSortedMap<K,V>
-
equals
public boolean equals(Object o)
-
hashCode
public int hashCode()
-
forEachKeyValue
public void forEachKeyValue(Procedure2<? super K,? super V> procedure2)
- Specified by:
forEachKeyValuein interfaceMapIterable<K,V>
-
entrySet
public MutableSet<Map.Entry<K,V>> entrySet()
-
keySet
public MutableSet<K> keySet()
-
values
public MutableCollection<V> values()
-
comparator
public Comparator<? super K> comparator()
- Specified by:
comparatorin interfaceSortedMap<K,V>- Specified by:
comparatorin interfaceSortedMapIterable<K,V>
-
containsKey
public boolean containsKey(Object key)
- Specified by:
containsKeyin interfaceMap<K,V>- Specified by:
containsKeyin interfaceMapIterable<K,V>
-
headMap
public MutableSortedMap<K,V> headMap(K toKey)
-
tailMap
public MutableSortedMap<K,V> tailMap(K fromKey)
-
subMap
public MutableSortedMap<K,V> subMap(K fromKey, K toKey)
-
containsValue
public boolean containsValue(Object value)
- Specified by:
containsValuein interfaceMap<K,V>- Specified by:
containsValuein interfaceMapIterable<K,V>
-
toReversed
public MutableSortedMap<K,V> toReversed()
- Specified by:
toReversedin interfaceMutableSortedMap<K,V>- Specified by:
toReversedin interfaceReversibleIterable<K>- Specified by:
toReversedin interfaceSortedMapIterable<K,V>
-
take
public MutableSortedMap<K,V> take(int count)
- Specified by:
takein interfaceMutableSortedMap<K,V>- Specified by:
takein interfaceReversibleIterable<K>- Specified by:
takein interfaceSortedMapIterable<K,V>
-
takeWhile
public MutableSortedMap<K,V> takeWhile(Predicate<? super V> predicate)
- Specified by:
takeWhilein interfaceMutableSortedMap<K,V>- Specified by:
takeWhilein interfaceOrderedIterable<K>- Specified by:
takeWhilein interfaceReversibleIterable<K>- Specified by:
takeWhilein interfaceSortedMapIterable<K,V>
-
drop
public MutableSortedMap<K,V> drop(int count)
- Specified by:
dropin interfaceMutableSortedMap<K,V>- Specified by:
dropin interfaceReversibleIterable<K>- Specified by:
dropin interfaceSortedMapIterable<K,V>
-
dropWhile
public MutableSortedMap<K,V> dropWhile(Predicate<? super V> predicate)
- Specified by:
dropWhilein interfaceMutableSortedMap<K,V>- Specified by:
dropWhilein interfaceOrderedIterable<K>- Specified by:
dropWhilein interfaceReversibleIterable<K>- Specified by:
dropWhilein interfaceSortedMapIterable<K,V>
-
partitionWhile
public PartitionMutableList<V> partitionWhile(Predicate<? super V> predicate)
- Specified by:
partitionWhilein interfaceMutableSortedMap<K,V>- Specified by:
partitionWhilein interfaceOrderedIterable<K>- Specified by:
partitionWhilein interfaceReversibleIterable<K>- Specified by:
partitionWhilein interfaceSortedMapIterable<K,V>
-
distinct
public MutableList<V> distinct()
- Specified by:
distinctin interfaceMutableSortedMap<K,V>- Specified by:
distinctin interfaceOrderedIterable<K>- Specified by:
distinctin interfaceReversibleIterable<K>- Specified by:
distinctin interfaceSortedMapIterable<K,V>
-
toString
public String toString()
Description copied from class:AbstractRichIterableReturns a string with the elements of the iterable separated by commas with spaces and enclosed in square brackets.Assert.assertEquals("[]", Lists.mutable.empty().toString()); Assert.assertEquals("[1]", Lists.mutable.with(1).toString()); Assert.assertEquals("[1, 2, 3]", Lists.mutable.with(1, 2, 3).toString());- Specified by:
toStringin interfaceMapIterable<K,V>- Specified by:
toStringin interfaceRichIterable<K>- Overrides:
toStringin classAbstractRichIterable<V>- Returns:
- a string representation of this collection.
- See Also:
AbstractCollection.toString()
-
writeExternal
public void writeExternal(ObjectOutput out) throws IOException
- Specified by:
writeExternalin interfaceExternalizable- Throws:
IOException
-
readExternal
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
- Specified by:
readExternalin interfaceExternalizable- Throws:
IOExceptionClassNotFoundException
-
-