List of usage examples for org.apache.lucene.util.automaton Operations union
public static Automaton union(Collection<Automaton> l)
From source file:org.codelibs.elasticsearch.common.regex.Regex.java
License:Apache License
/** * Return an Automaton that matches the union of the provided patterns. *///from www .ja v a2s. co m public static Automaton simpleMatchToAutomaton(String... patterns) { if (patterns.length < 1) { throw new IllegalArgumentException("There must be at least one pattern, zero given"); } List<Automaton> automata = new ArrayList<>(); for (String pattern : patterns) { automata.add(simpleMatchToAutomaton(pattern)); } return Operations.union(automata); }