| java.lang.Object kawa.lang.Pattern kawa.lang.ListPat
ListPat | public class ListPat extends Pattern (Code) | | Match a list whose length in in the range [min_length..max_length].
|
Method Summary | |
public static boolean | match(int min, int max, Object default_val, Object obj, Object[] vars, int start_vars) | public static Object[] | match(int min, int max, Object default_val, Object obj) Succeeds if obj is a list of length [min..max]. | public boolean | match(Object obj, Object[] vars, int start_vars) Succeeds if obj is a list of length [min_length..max_length]. | public void | print(Consumer out) | public int | varCount() |
max_length | int max_length(Code) | | Maximum length of list that will match.
|
min_length | int min_length(Code) | | Minimun length of list that will match.
|
ListPat | public ListPat(int len)(Code) | | |
ListPat | public ListPat(int min, int max)(Code) | | |
ListPat | public ListPat(int min, int max, Object default_val)(Code) | | |
match | public static Object[] match(int min, int max, Object default_val, Object obj)(Code) | | Succeeds if obj is a list of length [min..max].
Parameters: obj - the object to match against true iff the match succeededOn success, max_length values from the elements of the list are placedin vars (starting at start_vars); if obj is shorter, missing elementsare set to default_value. |
match | public boolean match(Object obj, Object[] vars, int start_vars)(Code) | | Succeeds if obj is a list of length [min_length..max_length].
Parameters: obj - the object to match against null on failure, or an array of bound pattern variables:max_length values from the elements of the list are placedin the result; if obj is shorter, missing elementsare set to default_value. |
varCount | public int varCount()(Code) | | |
|
|