public void addPattern(Pattern pattern) {
        if (patterns == null) {
            patterns = new ArrayList<Pattern>();
        }

        patterns.add(pattern);
    }
public void addPattern ( Pattern pattern ) { if ( patterns == null ) { patterns = new ArrayList < Pattern > ( ) ; } patterns . add ( pattern ) ; }
Add a pattern to the list of patterns.

@param pattern a pattern