public class ListPat extends Pattern
matchPatternMethod, typePattern
Constructor and Description |
---|
ListPat(int len) |
ListPat(int min,
int max) |
ListPat(int min,
int max,
java.lang.Object default_val) |
Modifier and Type | Method and Description |
---|---|
static java.lang.Object[] |
match(int min,
int max,
java.lang.Object default_val,
java.lang.Object obj)
Succeeds if obj is a list of length [min..max].
|
static boolean |
match(int min,
int max,
java.lang.Object default_val,
java.lang.Object obj,
java.lang.Object[] vars,
int start_vars) |
boolean |
match(java.lang.Object obj,
java.lang.Object[] vars,
int start_vars)
Succeeds if obj is a list of length [min_length..max_length].
|
void |
print(Consumer out) |
int |
varCount() |
public ListPat(int len)
public ListPat(int min, int max)
public ListPat(int min, int max, java.lang.Object default_val)
public static boolean match(int min, int max, java.lang.Object default_val, java.lang.Object obj, java.lang.Object[] vars, int start_vars)
public static java.lang.Object[] match(int min, int max, java.lang.Object default_val, java.lang.Object obj)
obj
- the object to match againstpublic boolean match(java.lang.Object obj, java.lang.Object[] vars, int start_vars)
match
in class Pattern
obj
- the object to match againstvars
- the "pattern variable" values extracted from obj go herestart_vars
- where in vars to strt putting the varCount() values