kawa.lang

Class VarListPat


public class VarListPat
extends Pattern

A Pattern that will match a list of a given minimum length.

Field Summary

Fields inherited from class kawa.lang.Pattern

matchPatternMethod, typePattern

Constructor Summary

VarListPat(int min)

Method Summary

boolean
match(Object obj, Object[] vars, int start_vars)
Succeeds of obj is a list with at least min_length elements.
int
varCount()

Methods inherited from class kawa.lang.Pattern

match, match, varCount

Constructor Details

VarListPat

public VarListPat(int min)

Method Details

match

public boolean match(Object obj,
                     Object[] vars,
                     int start_vars)
Succeeds of obj is a list with at least min_length elements.
Overrides:
match in interface Pattern
Parameters:
obj - the object to match against
Returns:
true if the match succeeded. The elements vars[start_vars .. start_vars + min_length] contain the first min_length elements of obj followed by the min_length'th cdr of obj.

varCount

public int varCount()
Overrides:
varCount in interface Pattern