Package net.hydromatic.morel.util
Class PairLists.MutablePairList<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.MutablePairList<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
Mutable version of
PairList.-
Nested Class Summary
Nested classes/interfaces inherited from interface net.hydromatic.morel.util.PairList
PairList.Builder<T,U>, PairList.IndexedBiConsumer<T, U> -
Field Summary
FieldsFields inherited from class java.util.AbstractList
modCount -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidAdds a pair to this list at a given position.booleanvoidAdds a pair to this list.booleanAdds to this list, at a given index, the contents of another PairList.booleanAdds to this list the contents of another PairList.booleanallMatch(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.voidclear()voidforEach(BiConsumer<T, U> consumer) Calls a BiConsumer with each pair in this list.voidforEachIndexed(PairList.IndexedBiConsumer<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.booleanisEmpty()left(int index) Returns the left part of theindexth pair.leftList()Returns an unmodifiable list view consisting of the left entry of each pair.booleannoMatch(BiPredicate<T, U> predicate) Returns whether the predicate is true for no pairs in this list.remove(int index) right(int index) Returns the right part of theindexth pair.Returns an unmodifiable list view consisting of the right entry of each pair.Sets the entry at positionindexto the pair(t, u).intsize()Creates anImmutableMapwhose entries are the pairs in this list.<R> List<R> transform(BiFunction<T, U, R> function) Applies a mapping function to each element of this list.<R> com.google.common.collect.ImmutableList<R> transform2(BiFunction<T, U, R> function) Applies a mapping function to each element of this list.Methods inherited from class java.util.AbstractList
addAll, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, removeRange, subListMethods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, remove, removeAll, retainAll, toArray, toArray, toStringMethods 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
addAll, addAll, addFirst, addLast, contains, containsAll, equals, getFirst, getLast, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeAll, removeFirst, removeLast, replaceAll, retainAll, reversed, sort, spliterator, subList, toArray, toArray
-
Field Details
-
list
-
-
Constructor Details
-
MutablePairList
-
-
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>
-
clear
public void clear() -
size
public int size() -
isEmpty
public boolean isEmpty() -
get
-
left
Description copied from interface:PairListReturns the left part of theindexth pair. -
right
Description copied from interface:PairListReturns the right part of theindexth pair. -
set
-
set
Description copied from interface:PairListSets the entry at positionindexto the pair(t, u). -
remove
-
add
-
add
-
add
Description copied from interface:PairListAdds a pair to this list. -
add
Description copied from interface:PairListAdds a pair to this list at a given position. -
addAll
Description copied from interface:PairListAdds to this list the contents of another PairList.Equivalent to
List.addAll(Collection), but more efficient. -
addAll
Description copied from interface:PairListAdds to this list, at a given index, the contents of another PairList.Equivalent to
List.addAll(int, Collection), but more efficient. -
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. -
forEachIndexed
Description copied from interface:PairListCalls a BiConsumer with each pair in this list. -
toImmutableMap
Description copied from interface:PairListCreates anImmutableMapwhose entries are the pairs in this list. Throws if keys are not unique. -
immutable
Description copied from interface:PairListReturns an ImmutablePairList whose contents are the same as this PairList. -
transform
Description copied from interface:PairListApplies a mapping function to each element of this list. -
transform2
Description copied from interface:PairListApplies a mapping function to each element of 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. -
noMatch
Description copied from interface:PairListReturns whether the predicate is true for no pairs in this list.
-