Package it.unimi.dsi.parser.callback
Class ComposedCallbackBuilder
- java.lang.Object
-
- it.unimi.dsi.parser.callback.ComposedCallbackBuilder
-
public class ComposedCallbackBuilder extends Object
A builder for composed callbacks.To compose a series of callbacks, you must first create an instance of this class, add all required callbacks, and finally get the composed callback, which will invoke (in order) the callbacks.
-
-
Constructor Summary
Constructors Constructor Description ComposedCallbackBuilder()Creates a new, empty callback composer.
-
Method Summary
Modifier and Type Method Description voidadd(int position, Callback callback)Adds a new callback to this builder at a specified position.voidadd(Callback callback)Adds a new callback to this builder.Callbackcompose()Returns the composed callback produced by this builder.booleanisEmpty()Checks whether this callback builder is empty.intsize()Returns the number of callbacks in this builder.
-
-
-
Method Detail
-
add
public void add(int position, Callback callback)Adds a new callback to this builder at a specified position.- Parameters:
position- a position in the current callback list.callback- a callback.
-
add
public void add(Callback callback)
Adds a new callback to this builder.- Parameters:
callback- a callback.
-
isEmpty
public boolean isEmpty()
Checks whether this callback builder is empty.- Returns:
- true if this callback builder is empty.
-
size
public int size()
Returns the number of callbacks in this builder.- Returns:
- the number of callbacks in this composer.
-
compose
public Callback compose()
Returns the composed callback produced by this builder.- Returns:
- a composed callback.
-
-