Class PairLists.EmptyImmutablePairList<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>>, ImmutablePairList<T,U>, PairList<T,U>
Enclosing class:
PairLists

static class PairLists.EmptyImmutablePairList<T,U> extends PairLists.AbstractPairList<T,U> implements ImmutablePairList<T,U>
Empty immutable list of pairs.
  • Constructor Details

    • EmptyImmutablePairList

      EmptyImmutablePairList()
  • Method Details

    • backingList

      List<Object> backingList()
      Description copied from class: PairLists.AbstractPairList
      Returns a list containing the alternating left and right elements of each pair.
      Specified by:
      backingList in class PairLists.AbstractPairList<T,U>
    • get

      public Map.Entry<T,U> get(int index)
      Specified by:
      get in interface List<T>
      Specified by:
      get in class AbstractList<Map.Entry<T,U>>
    • 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>
    • size

      public int size()
      Specified by:
      size in interface Collection<T>
      Specified by:
      size in interface List<T>
      Specified by:
      size in class AbstractCollection<Map.Entry<T,U>>
    • leftList

      public List<T> leftList()
      Description copied from interface: PairList
      Returns an unmodifiable list view consisting of the left entry of each pair.
      Specified by:
      leftList in interface PairList<T,U>
    • rightList

      public List<U> rightList()
      Description copied from interface: PairList
      Returns an unmodifiable list view consisting of the right entry of each pair.
      Specified by:
      rightList in interface PairList<T,U>
    • forEach

      public void forEach(BiConsumer<T,U> consumer)
      Description copied from interface: PairList
      Calls a BiConsumer with each pair in this list.
      Specified by:
      forEach 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>
    • anyMatch

      public boolean anyMatch(BiPredicate<T,U> predicate)
      Description copied from interface: PairList
      Returns whether the predicate is true for at least one pair in this list.
      Specified by:
      anyMatch in interface PairList<T,U>
    • allMatch

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

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