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

java.lang.Object
google.registry.util.CircularList.AbstractBuilder<T,C>
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 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.