Class CircularList.AbstractBuilder<T,​C extends CircularList<T>>

  • Type Parameters:
    T - - Matching element type of iterator

    Supports adding in element at a time, adding an Iterable of elements, and adding an variable number of elemetns.

    Sets first element added to first, and when built, points last element to the first element.

    Direct Known Subclasses:
    CircularList.Builder, ProbingSequence.Builder
    Enclosing class:
    CircularList<T>

    public abstract static class CircularList.AbstractBuilder<T,​C extends CircularList<T>>
    extends java.lang.Object
    As CircularList represents one component of the entire list, it requires a builder to create the full list.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected C current  
      protected C first  
    • Constructor Summary

      Constructors 
      Constructor Description
      AbstractBuilder()  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      CircularList.AbstractBuilder<T,​C> add​(java.lang.Iterable<T> values)
      Simply calls addElement, for each element in elements.
      CircularList.AbstractBuilder<T,​C> add​(T value)
      Sets current C to element added and points previous C to this one.
      C build()
      Sets the next C of the list to be the first C in the list.
      protected abstract C create​(T value)
      Necessary to instantiate each C object from value.
      • Methods inherited from class java.lang.Object

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

      • AbstractBuilder

        public AbstractBuilder()
    • Method Detail

      • create

        protected abstract C create​(T value)
        Necessary to instantiate each C object from value.
      • build

        public C build()
        Sets the next C of the list to be the first C in the list.