Class LinkedLists


  • public class LinkedLists
    extends java.lang.Object
    LinkedLists is the preferred method of constructing instances of LinkedList.

    ConsList is currently constructed in all cases, however this may change in the future.

    LinkedLists is preferred for construction as:

    • It works better in languages that support type inference
    • It allows future optimisations (e.g. small lists might start as arrays and get upgraded to ConsLists)
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private LinkedLists()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <E> @NotNull Builder<E,​LinkedList<E>> builder()  
      private static <E> LinkedList<E> construct​(E... es)  
      static <E> @NotNull LinkedList<E> copyOf​(E[] es)  
      static <E> @NotNull LinkedList<E> copyOf​(java.lang.Iterable<E> iterable)  
      static <E> @NotNull LinkedList<E> copyOf​(java.util.Iterator<E> iterator)  
      static <E> @NotNull LinkedList<E> copyOfTraversable​(Traversable<E> traversable)  
      static <E> @NotNull BuilderFactory<E,​LinkedList<E>> factory()  
      static <E> @NotNull LinkedList<E> of()  
      static <E> @NotNull LinkedList<E> of​(E t)  
      static <E> @NotNull LinkedList<E> of​(E e1, E e2)  
      static <E> @NotNull LinkedList<E> of​(E e1, E e2, E e3)  
      static <E> @NotNull LinkedList<E> of​(E e1, E e2, E e3, E e4)  
      static <E> @NotNull LinkedList<E> of​(E e1, E e2, E e3, E e4, E e5)  
      static <E> @NotNull LinkedList<E> of​(E e1, E e2, E e3, E e4, E e5, E e6)  
      static <E> @NotNull LinkedList<E> of​(E e1, E e2, E e3, E e4, E e5, E e6, E e7)  
      static <E> @NotNull LinkedList<E> of​(E e1, E e2, E e3, E e4, E e5, E e6, E e7, E e8)  
      static <E> @NotNull LinkedList<E> of​(E e1, E e2, E e3, E e4, E e5, E e6, E e7, E e8, E e9)  
      static <E> @NotNull LinkedList<E> of​(E e1, E e2, E e3, E e4, E e5, E e6, E e7, E e8, E e9, E e10)  
      static <E> @NotNull LinkedList<E> of​(E e1, E e2, E e3, E e4, E e5, E e6, E e7, E e8, E e9, E e10, E... others)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • LinkedLists

        private LinkedLists()
    • Method Detail

      • of

        @NotNull
        public static <E> @NotNull LinkedList<E> of()
      • of

        @NotNull
        public static <E> @NotNull LinkedList<E> of​(E t)
      • of

        @NotNull
        public static <E> @NotNull LinkedList<E> of​(E e1,
                                                    E e2)
      • of

        @NotNull
        public static <E> @NotNull LinkedList<E> of​(E e1,
                                                    E e2,
                                                    E e3)
      • of

        @NotNull
        public static <E> @NotNull LinkedList<E> of​(E e1,
                                                    E e2,
                                                    E e3,
                                                    E e4)
      • of

        @NotNull
        public static <E> @NotNull LinkedList<E> of​(E e1,
                                                    E e2,
                                                    E e3,
                                                    E e4,
                                                    E e5)
      • of

        @NotNull
        public static <E> @NotNull LinkedList<E> of​(E e1,
                                                    E e2,
                                                    E e3,
                                                    E e4,
                                                    E e5,
                                                    E e6)
      • of

        @NotNull
        public static <E> @NotNull LinkedList<E> of​(E e1,
                                                    E e2,
                                                    E e3,
                                                    E e4,
                                                    E e5,
                                                    E e6,
                                                    E e7)
      • of

        @NotNull
        public static <E> @NotNull LinkedList<E> of​(E e1,
                                                    E e2,
                                                    E e3,
                                                    E e4,
                                                    E e5,
                                                    E e6,
                                                    E e7,
                                                    E e8)
      • of

        @NotNull
        public static <E> @NotNull LinkedList<E> of​(E e1,
                                                    E e2,
                                                    E e3,
                                                    E e4,
                                                    E e5,
                                                    E e6,
                                                    E e7,
                                                    E e8,
                                                    E e9)
      • of

        @NotNull
        public static <E> @NotNull LinkedList<E> of​(E e1,
                                                    E e2,
                                                    E e3,
                                                    E e4,
                                                    E e5,
                                                    E e6,
                                                    E e7,
                                                    E e8,
                                                    E e9,
                                                    E e10)
      • of

        @NotNull
        public static <E> @NotNull LinkedList<E> of​(E e1,
                                                    E e2,
                                                    E e3,
                                                    E e4,
                                                    E e5,
                                                    E e6,
                                                    E e7,
                                                    E e8,
                                                    E e9,
                                                    E e10,
                                                    E... others)
      • construct

        private static <E> LinkedList<E> construct​(E... es)
      • copyOf

        @NotNull
        public static <E> @NotNull LinkedList<E> copyOf​(java.lang.Iterable<E> iterable)
      • copyOf

        @NotNull
        public static <E> @NotNull LinkedList<E> copyOf​(java.util.Iterator<E> iterator)
      • copyOf

        @NotNull
        public static <E> @NotNull LinkedList<E> copyOf​(E[] es)
      • copyOfTraversable

        @NotNull
        public static <E> @NotNull LinkedList<E> copyOfTraversable​(Traversable<E> traversable)
      • builder

        @NotNull
        public static <E> @NotNull Builder<E,​LinkedList<E>> builder()