Package jgraspvex

Class DoublyLinkedList<T extends java.lang.Comparable<T>>

  • All Implemented Interfaces:
    java.lang.Iterable<T>, java.util.Collection<T>, java.util.List<T>

    public class DoublyLinkedList<T extends java.lang.Comparable<T>>
    extends java.util.AbstractSequentialList<T>
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      private class  DoublyLinkedList.Iter  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(int index, T value)  
      boolean add​(T value)  
      T get​(int index)  
      private DoublyLinkedNode<T> getPrev​(int index)  
      java.util.ListIterator<T> listIterator​(int index)  
      void printValues()  
      T remove​(int index)  
      void selectionSort()  
      int size()  
      void swap​(DoublyLinkedNode<T> n1, DoublyLinkedNode<T> n2)  
      • Methods inherited from class java.util.AbstractSequentialList

        addAll, iterator, set
      • Methods inherited from class java.util.AbstractList

        clear, equals, hashCode, indexOf, lastIndexOf, listIterator, removeRange, 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

        forEach
      • Methods inherited from interface java.util.List

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

      • DoublyLinkedList

        public DoublyLinkedList()
    • Method Detail

      • add

        public boolean add​(T value)
        Specified by:
        add in interface java.util.Collection<T extends java.lang.Comparable<T>>
        Specified by:
        add in interface java.util.List<T extends java.lang.Comparable<T>>
        Overrides:
        add in class java.util.AbstractList<T extends java.lang.Comparable<T>>
      • add

        public void add​(int index,
                        T value)
                 throws java.lang.IndexOutOfBoundsException
        Specified by:
        add in interface java.util.List<T extends java.lang.Comparable<T>>
        Overrides:
        add in class java.util.AbstractSequentialList<T extends java.lang.Comparable<T>>
        Throws:
        java.lang.IndexOutOfBoundsException
      • remove

        public T remove​(int index)
                 throws java.lang.IndexOutOfBoundsException
        Specified by:
        remove in interface java.util.List<T extends java.lang.Comparable<T>>
        Overrides:
        remove in class java.util.AbstractSequentialList<T extends java.lang.Comparable<T>>
        Throws:
        java.lang.IndexOutOfBoundsException
      • size

        public int size()
        Specified by:
        size in interface java.util.Collection<T extends java.lang.Comparable<T>>
        Specified by:
        size in interface java.util.List<T extends java.lang.Comparable<T>>
        Specified by:
        size in class java.util.AbstractCollection<T extends java.lang.Comparable<T>>
      • get

        public T get​(int index)
              throws java.lang.IndexOutOfBoundsException
        Specified by:
        get in interface java.util.List<T extends java.lang.Comparable<T>>
        Overrides:
        get in class java.util.AbstractSequentialList<T extends java.lang.Comparable<T>>
        Throws:
        java.lang.IndexOutOfBoundsException
      • selectionSort

        public void selectionSort()
      • printValues

        public void printValues()
      • listIterator

        public java.util.ListIterator<T> listIterator​(int index)
        Specified by:
        listIterator in interface java.util.List<T extends java.lang.Comparable<T>>
        Specified by:
        listIterator in class java.util.AbstractSequentialList<T extends java.lang.Comparable<T>>