org.javimmutable.collections.tree_list
Class JImmutableTreeList.Builder<T>

java.lang.Object
  extended by org.javimmutable.collections.tree_list.JImmutableTreeList.Builder<T>
All Implemented Interfaces:
JImmutableRandomAccessList.Builder<T>, MutableBuilder<T,JImmutableRandomAccessList<T>>
Enclosing class:
JImmutableTreeList<T>

public static class JImmutableTreeList.Builder<T>
extends Object
implements JImmutableRandomAccessList.Builder<T>


Constructor Summary
JImmutableTreeList.Builder()
           
 
Method Summary
 JImmutableTreeList.Builder<T> add(Collection<? extends T> source)
          Adds all values in the Collection to the values included in the collection when build() is called.
 JImmutableTreeList.Builder<T> add(Cursor<? extends T> source)
          Adds all values in the Cursor to the values included in the collection when build() is called.
 JImmutableTreeList.Builder<T> add(Indexed<? extends T> source)
          Adds all values in the Indexed to the values included in the collection when build() is called.
 JImmutableTreeList.Builder<T> add(Indexed<? extends T> source, int offset, int limit)
          Adds all values in the specified range of Indexed to the values included in the collection when build() is called.
 JImmutableTreeList.Builder<T> add(Iterator<? extends T> source)
          Adds all values in the Iterator to the values included in the collection when build() is called.
<K extends T>
JImmutableTreeList.Builder<T>
add(K... source)
          Adds all values in the array to the values included in the collection when build() is called.
 JImmutableTreeList.Builder<T> add(T value)
          Adds the specified value to the values included in the collection when build() is called.
 JImmutableTreeList<T> build()
          Builds and returns a collection containing all of the added values.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JImmutableTreeList.Builder

public JImmutableTreeList.Builder()
Method Detail

add

@Nonnull
public JImmutableTreeList.Builder<T> add(T value)
Description copied from interface: MutableBuilder
Adds the specified value to the values included in the collection when build() is called.

Specified by:
add in interface MutableBuilder<T,JImmutableRandomAccessList<T>>
Returns:
the builder (convenience for chaining multiple calls)

build

@Nonnull
public JImmutableTreeList<T> build()
Description copied from interface: MutableBuilder
Builds and returns a collection containing all of the added values. Usually build() can only be called once for a single MutableBuilder instance although implementing classes are not required to enforce this restriction.

Specified by:
build in interface MutableBuilder<T,JImmutableRandomAccessList<T>>
Returns:
the collection

add

@Nonnull
public JImmutableTreeList.Builder<T> add(Cursor<? extends T> source)
Description copied from interface: MutableBuilder
Adds all values in the Cursor to the values included in the collection when build() is called.

Specified by:
add in interface MutableBuilder<T,JImmutableRandomAccessList<T>>
Parameters:
source - Cursor containing values to add
Returns:
the builder (convenience for chaining multiple calls)

add

@Nonnull
public JImmutableTreeList.Builder<T> add(Iterator<? extends T> source)
Description copied from interface: MutableBuilder
Adds all values in the Iterator to the values included in the collection when build() is called.

Specified by:
add in interface MutableBuilder<T,JImmutableRandomAccessList<T>>
Parameters:
source - Iterator containing values to add
Returns:
the builder (convenience for chaining multiple calls)

add

@Nonnull
public JImmutableTreeList.Builder<T> add(Collection<? extends T> source)
Description copied from interface: MutableBuilder
Adds all values in the Collection to the values included in the collection when build() is called.

Specified by:
add in interface MutableBuilder<T,JImmutableRandomAccessList<T>>
Parameters:
source - Collection containing values to add
Returns:
the builder (convenience for chaining multiple calls)

add

@Nonnull
public <K extends T> JImmutableTreeList.Builder<T> add(K... source)
Description copied from interface: MutableBuilder
Adds all values in the array to the values included in the collection when build() is called.

Specified by:
add in interface MutableBuilder<T,JImmutableRandomAccessList<T>>
Parameters:
source - array containing values to add
Returns:
the builder (convenience for chaining multiple calls)

add

@Nonnull
public JImmutableTreeList.Builder<T> add(Indexed<? extends T> source)
Description copied from interface: MutableBuilder
Adds all values in the Indexed to the values included in the collection when build() is called.

Specified by:
add in interface MutableBuilder<T,JImmutableRandomAccessList<T>>
Parameters:
source - Indexed containing values to add
Returns:
the builder (convenience for chaining multiple calls)

add

@Nonnull
public JImmutableTreeList.Builder<T> add(Indexed<? extends T> source,
                                                 int offset,
                                                 int limit)
Description copied from interface: MutableBuilder
Adds all values in the specified range of Indexed to the values included in the collection when build() is called.

Specified by:
add in interface MutableBuilder<T,JImmutableRandomAccessList<T>>
Parameters:
source - Indexed containing values to add
Returns:
the builder (convenience for chaining multiple calls)


Copyright © 2014 Burton Computer Corporation. All rights reserved.