Package net.hydromatic.morel.util
Class PairLists.MapPairList<T,U>
java.lang.Object
java.util.AbstractCollection<Map.Entry<T,U>>
java.util.AbstractList<Map.Entry<T,U>>
net.hydromatic.morel.util.PairLists.AbstractPairList<T,U>
net.hydromatic.morel.util.PairLists.MapPairList<T,U>
- Type Parameters:
T- First typeU- Second type
- All Implemented Interfaces:
Iterable<Map.Entry<T,,U>> Collection<Map.Entry<T,,U>> List<Map.Entry<T,,U>> SequencedCollection<Map.Entry<T,,U>> PairList<T,U>
- Enclosing class:
PairLists
List of pairs backed by a map.
It works for all maps, but is efficient only if ImmutableList.copyOf(Iterable) on the key-set and value-set are O(0).
Therefore, we recommend using it only with maps that extend ImmutableMap.
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.hydromatic.morel.util.PairList
PairList.Builder<T,U>, PairList.IndexedBiConsumer<T, U> -
Field Summary
FieldsModifier and TypeFieldDescriptionFields inherited from class java.util.AbstractList
modCount -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanallMatch(BiPredicate<T, U> predicate) Returns whether the predicate is true for all pairs in this list.booleananyMatch(BiPredicate<T, U> predicate) Returns whether the predicate is true for at least one pair in this list.Returns a list containing the alternating left and right elements of each pair.intfirstMatch(BiPredicate<T, U> predicate) Returns the index of the first match of a predicate.voidforEach(BiConsumer<T, U> consumer) Calls a BiConsumer with each pair in this list.get(int index) Returns an ImmutablePairList whose contents are the same as this PairList.iterator()left(int index) Returns the left part of theindexth pair.leftList()Returns an unmodifiable list view consisting of the left entry of each pair.right(int index) Returns the right part of theindexth pair.Returns an unmodifiable list view consisting of the right entry of each pair.intsize()toString()Methods inherited from class net.hydromatic.morel.util.PairLists.AbstractPairList
forEachIndexed, noneMatch, transform, transform2Methods inherited from class java.util.AbstractList
add, add, addAll, clear, equals, hashCode, indexOf, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subListMethods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArrayMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface java.util.List
add, add, addAll, addAll, addFirst, addLast, clear, contains, containsAll, equals, getFirst, getLast, hashCode, indexOf, isEmpty, lastIndexOf, listIterator, listIterator, remove, removeAll, removeFirst, removeLast, replaceAll, retainAll, reversed, sort, spliterator, subList, toArray, toArray
-
Field Details
-
map
-
leftList
-
rightList
-
-
Constructor Details
-
MapPairList
-
-
Method Details
-
backingList
Description copied from class:PairLists.AbstractPairListReturns a list containing the alternating left and right elements of each pair.- Specified by:
backingListin classPairLists.AbstractPairList<T,U>
-
immutable
Description copied from interface:PairListReturns an ImmutablePairList whose contents are the same as this PairList. -
toString
- Overrides:
toStringin classAbstractCollection<Map.Entry<T,U>>
-
left
Description copied from interface:PairListReturns the left part of theindexth pair. -
right
Description copied from interface:PairListReturns the right part of theindexth pair. -
leftList
Description copied from interface:PairListReturns an unmodifiable list view consisting of the left entry of each pair. -
rightList
Description copied from interface:PairListReturns an unmodifiable list view consisting of the right entry of each pair. -
forEach
Description copied from interface:PairListCalls a BiConsumer with each pair in this list. -
anyMatch
Description copied from interface:PairListReturns whether the predicate is true for at least one pair in this list. -
allMatch
Description copied from interface:PairListReturns whether the predicate is true for all pairs in this list. -
firstMatch
Description copied from interface:PairListReturns the index of the first match of a predicate. -
size
public int size() -
iterator
-
get
-