Class SequenceBuilder

java.lang.Object
org.midheaven.collections.SequenceBuilder

public class SequenceBuilder extends Object
Builder for Sequence instances.
  • Constructor Details

    • SequenceBuilder

      public SequenceBuilder()
  • Method Details

    • withSize

      public SequenceBuilder withSize(long size)
      Performs withSize.
      Parameters:
      size - the size value
      Returns:
      the result of withSize
    • editable

      public EditableSequenceBuilder editable()
      Performs editable.
      Returns:
      the result of editable
    • resizable

      public ResizableSequenceBuilder resizable()
      Performs resizable.
      Returns:
      the result of resizable
    • empty

      public <U> Sequence<U> empty()
      Returns an empty instance.
      Returns:
      the result of empty
    • of

      public <U> Sequence<U> of(U value)
      Creates an instance from the provided value.
      Parameters:
      value - the value value
      Returns:
      the result of of
    • of

      public <U> Sequence<U> of(U a, U b, U... others)
      Creates an instance from the provided value.
      Parameters:
      a - the a value
      b - the b value
      others - the others value
      Returns:
      the result of of
    • of

      public <U> Sequence<U> of(U[] values)
      Creates an instance from the provided value.
      Parameters:
      values - the values value
      Returns:
      the result of of
    • repeat

      public <U> Sequence<U> repeat(U value)
      Performs repeat.
      Parameters:
      value - the value value
      Returns:
      the result of repeat
    • immutable

      public <T> Sequence<T> immutable(EditableSequence<T> origin)
      Returns a Sequence that does not inherit from EditableSequence
      Type Parameters:
      T -
      Parameters:
      origin -
      Returns:
    • from

      public <T> Sequence<T> from(Iterable<T> origin)
      Create a Sequence with elements from the given iterable
      Type Parameters:
      T -
      Parameters:
      origin -
      Returns: