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:

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

  • Constructor Details

    • AbstractBuilder

      public AbstractBuilder()
  • Method Details

    • create

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

      public CircularList.AbstractBuilder<T,C> add(T value)
      Sets current C to element added and points previous C to this one.
    • add

      public CircularList.AbstractBuilder<T,C> add(Iterable<T> values)
      Simply calls addElement, for each element in elements.
    • build

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