Package eu.bandm.tools.paisley
Class IntBranch.Builder<A>
java.lang.Object
eu.bandm.tools.paisley.IntBranch.Builder<A>
- Type Parameters:
A- the target type of objects to match against
Incremental builder.
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
Builder
public Builder()Creates a new empty builder. -
Builder
Creates a new builder with a single branch.- Parameters:
subpattern- the subpattern of the branch- Throws:
NullPointerException- ifsubpatternis null
-
-
Method Details
-
add
Adds a next branch to this builder.This method uses
List.add(E)internally; the new branch is assigned the next free index, which is equal to the current size of the list.- Parameters:
subpattern- the subpattern for the new branch- Returns:
this- Throws:
NullPointerException- ifkeyorsubpatternis null
-
clear
public void clear()Removes all branches of this builder. -
build
Creates a new pattern with the current content of this builder.After pattern creation, this builder may be reused.
- Returns:
- a pattern with the same branches as the current content of this builder
-