Class AdjacencyList<T>

  • Type Parameters:
    T - List item type.
    All Implemented Interfaces:
    java.lang.Iterable<T>

    public final class AdjacencyList<T>
    extends java.lang.Object
    implements java.lang.Iterable<T>
    The AdjacencyList class is an implementation of list that facilitates dealing with adjacent items.
    • Constructor Detail

      • AdjacencyList

        public AdjacencyList()
    • Method Detail

      • iterator

        public java.util.Iterator<T> iterator()
        Specified by:
        iterator in interface java.lang.Iterable<T>
      • isEmpty

        public boolean isEmpty()
      • contains

        public boolean contains​(T obj)
      • clear

        public void clear()
      • getFirst

        public T getFirst()
      • getLast

        public T getLast()
      • getPrevious

        public T getPrevious​(T obj)
      • getNext

        public T getNext​(T obj)
      • add

        public void add​(T obj)
      • addAfter

        public void addAfter​(T previous,
                             T current)
      • replaceWith

        public void replaceWith​(T previous,
                                T current)
      • remove

        public void remove​(T obj)