Class TrieArray.Builder<T>
java.lang.Object
org.javimmutable.collections.array.TrieArray.Builder<T>
- All Implemented Interfaces:
IArrayBuilder<T>
-
Method Summary
Modifier and TypeMethodDescriptionAdds the specified value to the values included in the collection when build() is called.build()
Builds and returns a collection containing all of the added values.clear()
Removes all objects and resets the builder to it's initial post-build state.Adds the specified value to the values included in the collection when build() is called.setNextIndex
(int index) Sets the index at which next call to add() will insert the value.int
size()
Determines how many values will be in the collection if build() is called now.
-
Method Details
-
size
public int size()Description copied from interface:IArrayBuilder
Determines how many values will be in the collection if build() is called now.- Specified by:
size
in interfaceIArrayBuilder<T>
-
clear
Description copied from interface:IArrayBuilder
Removes all objects and resets the builder to it's initial post-build state.- Specified by:
clear
in interfaceIArrayBuilder<T>
- Returns:
- the builder (convenience for chaining multiple calls)
-
add
Description copied from interface:IArrayBuilder
Adds the specified value to the values included in the collection when build() is called.- Specified by:
add
in interfaceIArrayBuilder<T>
- Returns:
- the builder (convenience for chaining multiple calls)
-
put
Description copied from interface:IArrayBuilder
Adds the specified value to the values included in the collection when build() is called.- Specified by:
put
in interfaceIArrayBuilder<T>
- Returns:
- the builder (convenience for chaining multiple calls)
-
setNextIndex
Description copied from interface:IArrayBuilder
Sets the index at which next call to add() will insert the value.- Specified by:
setNextIndex
in interfaceIArrayBuilder<T>
-
build
Description copied from interface:IArrayBuilder
Builds and returns a collection containing all of the added values. May be called as often as desired and is safe to call and then continue adding more elements to build another collection with those additional elements.- Specified by:
build
in interfaceIArrayBuilder<T>
- Returns:
- the collection
-