Class Pair.ZipList<K,​V>

  • Type Parameters:
    K - Left-hand type
    V - Right-hand type
    All Implemented Interfaces:
    java.lang.Iterable<Pair<K,​V>>, java.util.Collection<Pair<K,​V>>, java.util.List<Pair<K,​V>>
    Enclosing class:

    private static class Pair.ZipList<K,​V>
    extends java.util.AbstractList<Pair<K,​V>>
    Unmodifiable list of pairs, backed by a pair of lists.

    Though it is unmodifiable, it is mutable: if the contents of one of the backing lists changes, the contents of this list will appear to change. The length, however, is fixed on creation.

    See Also:
    • Field Summary

      Modifier and Type Field Description
      private java.util.List<K> ks  
      private int size  
      private java.util.List<V> vs  
      • Fields inherited from class java.util.AbstractList

    • Constructor Summary

      Constructor Description
      ZipList​(java.util.List<K> ks, java.util.List<V> vs, int size)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Pair<K,​V> get​(int index)  
      int size()  
      • Methods inherited from class java.util.AbstractList

        add, add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subList
      • Methods inherited from class java.util.AbstractCollection

        addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.Collection

        parallelStream, removeIf, stream, toArray
      • Methods inherited from interface java.lang.Iterable

      • Methods inherited from interface java.util.List

        addAll, contains, containsAll, isEmpty, remove, removeAll, replaceAll, retainAll, sort, spliterator, toArray, toArray
    • Field Detail

      • ks

        private final java.util.List<K> ks
      • vs

        private final java.util.List<V> vs
      • size

        private final int size
    • Constructor Detail

      • ZipList

        ZipList​(java.util.List<K> ks,
                java.util.List<V> vs,
                int size)
    • Method Detail

      • get

        public Pair<K,​V> get​(int index)
        Specified by:
        get in interface java.util.List<K>
        Specified by:
        get in class java.util.AbstractList<Pair<K,​V>>
      • size

        public int size()
        Specified by:
        size in interface java.util.Collection<K>
        Specified by:
        size in interface java.util.List<K>
        Specified by:
        size in class java.util.AbstractCollection<Pair<K,​V>>