File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed
src/main/java/org/bk/ass/bt Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,9 @@ public enum Policy {
22
22
SELECTOR
23
23
}
24
24
25
+ /**
26
+ * Initializes with the default policy {@link Policy#SEQUENCE}.
27
+ */
25
28
public Parallel (TreeNode ... children ) {
26
29
super (children );
27
30
policy = Policy .SEQUENCE ;
Original file line number Diff line number Diff line change @@ -44,18 +44,30 @@ public Repeat(Policy policy, TreeNode delegate) {
44
44
this .policy = policy ;
45
45
}
46
46
47
+ /**
48
+ * Initializes with the default policy {@link Policy#SEQUENCE}.
49
+ */
47
50
public Repeat (TreeNode delegate ) {
48
51
this (Policy .SEQUENCE , delegate );
49
52
}
50
53
54
+ /**
55
+ * Initializes with the default policy {@link Policy#SEQUENCE}.
56
+ */
51
57
public Repeat (int limit , TreeNode delegate ) {
52
58
this (Policy .SEQUENCE , limit , delegate );
53
59
}
54
60
61
+ /**
62
+ * Allows to configure a limit of repeats. After exhaustion, it will either succeed, if policy is
63
+ * SEQUENCE or fail if the policy is SELECTOR.
64
+ */
55
65
public Repeat (Policy policy , int limit , TreeNode delegate ) {
56
66
super (delegate );
57
67
Objects .requireNonNull (policy , "policy must be set" );
58
- if (limit < 0 ) throw new IllegalArgumentException ("limit must be >= 0" );
68
+ if (limit < 0 ) {
69
+ throw new IllegalArgumentException ("limit must be >= 0" );
70
+ }
59
71
this .remaining = this .initialLimit = limit ;
60
72
this .policy = policy ;
61
73
}
You can’t perform that action at this time.
0 commit comments