Package org.midheaven.collections
Interface AssociatedEnumerable<K,V>
- Type Parameters:
K- the type of the keyV- the type of the value
- All Superinterfaces:
Enumerable<Association.Entry<K,,V>> Iterable<Association.Entry<K,V>>
An
Enumerable of Association.Entrys with additional operations-
Method Summary
Modifier and TypeMethodDescriptiondefault <Q,W> AssociatedEnumerable <Q, W> mapEntries(Function<Association.Entry<K, V>, Association.Entry<Q, W>> mapper) MapsAssociation.Entryto newAssociation.Entrydefault <Q> AssociatedEnumerable<Q, V> Maps existing keys to new keys , keeping the same valuesdefault <W> AssociatedEnumerable<K, W> Maps existing keys to new values , keeping the same keysdefault Association<K, V> Returns an Association with the keys and values inthisMethods inherited from interface org.midheaven.collections.Enumerable
allMatch, any, anyMatch, as, associate, associate, cast, collect, concat, count, distinct, enumerator, filter, first, flatMap, groupBy, isEmpty, iterator, limit, map, maximum, minimum, ofType, peek, reduce, reduce, skip, sorted, toArray, toArray, toArray, toDistinctAssortment, toSequence, toSequence, with, zipMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Method Details
-
toAssociation
Returns an Association with the keys and values inthis- Returns:
- the result of toAssociation
-
mapEntries
default <Q,W> AssociatedEnumerable<Q,W> mapEntries(Function<Association.Entry<K, V>, Association.Entry<Q, W>> mapper) MapsAssociation.Entryto newAssociation.Entry- Parameters:
mapper- the mapping function- Returns:
- a new
AssociatedEnumerableof the new entries
-
mapKey
Maps existing keys to new keys , keeping the same values- Parameters:
mapper- the mapping function- Returns:
- a new
AssociatedEnumerableof the new entries with keys changed
-
mapValue
Maps existing keys to new values , keeping the same keys- Parameters:
mapper- the mapping function- Returns:
- a new
AssociatedEnumerableof the new entries with values changed
-