Class PairLists.AbstractPairList<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>
Type Parameters:
T - First type
U - 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>
Direct Known Subclasses:
PairLists.ArrayImmutablePairList, PairLists.EmptyImmutablePairList, PairLists.MapPairList, PairLists.MutablePairList, PairLists.SingletonImmutablePairList
Enclosing class:
PairLists

abstract static class PairLists.AbstractPairList<T,U> extends AbstractList<Map.Entry<T,U>> implements PairList<T,U>
Base class for all implementations of PairList.
  • Constructor Details

    • AbstractPairList

      AbstractPairList()
  • Method Details

    • backingList

      abstract List<Object> backingList()
      Returns a list containing the alternating left and right elements of each pair.
    • left

      public T left(int index)
      Description copied from interface: PairList
      Returns the left part of the indexth pair.
      Specified by:
      left in interface PairList<T,U>
    • right

      public U right(int index)
      Description copied from interface: PairList
      Returns the right part of the indexth pair.
      Specified by:
      right in interface PairList<T,U>
    • forEachIndexed

      public void forEachIndexed(PairList.IndexedBiConsumer<T,U> consumer)
      Description copied from interface: PairList
      Calls a BiConsumer with each pair in this list.
      Specified by:
      forEachIndexed in interface PairList<T,U>
    • transform

      public <R> List<R> transform(BiFunction<T,U,R> function)
      Description copied from interface: PairList
      Applies a mapping function to each element of this list.
      Specified by:
      transform in interface PairList<T,U>
    • transform2

      public <R> com.google.common.collect.ImmutableList<R> transform2(BiFunction<T,U,R> function)
      Description copied from interface: PairList
      Applies a mapping function to each element of this list.
      Specified by:
      transform2 in interface PairList<T,U>
    • noneMatch

      public boolean noneMatch(BiPredicate<T,U> predicate)
      Description copied from interface: PairList
      Returns whether the predicate is true for no pairs in this list.
      Specified by:
      noneMatch in interface PairList<T,U>