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.intsize()Determines how many values will be in the collection if build() is called now.
-
Method Details
-
size
public int size()Description copied from interface:IArrayBuilderDetermines how many values will be in the collection if build() is called now.- Specified by:
sizein interfaceIArrayBuilder<T>
-
clear
Description copied from interface:IArrayBuilderRemoves all objects and resets the builder to it's initial post-build state.- Specified by:
clearin interfaceIArrayBuilder<T>- Returns:
- the builder (convenience for chaining multiple calls)
-
add
Description copied from interface:IArrayBuilderAdds the specified value to the values included in the collection when build() is called.- Specified by:
addin interfaceIArrayBuilder<T>- Returns:
- the builder (convenience for chaining multiple calls)
-
put
Description copied from interface:IArrayBuilderAdds the specified value to the values included in the collection when build() is called.- Specified by:
putin interfaceIArrayBuilder<T>- Returns:
- the builder (convenience for chaining multiple calls)
-
setNextIndex
Description copied from interface:IArrayBuilderSets the index at which next call to add() will insert the value.- Specified by:
setNextIndexin interfaceIArrayBuilder<T>
-
build
Description copied from interface:IArrayBuilderBuilds 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:
buildin interfaceIArrayBuilder<T>- Returns:
- the collection
-