@Test public void testRegexMatchesList() { String textString = "gcatcgcagagagtatacagtacg"; List<String> pattern = Arrays.asList("g", "a", "g"); List<String> textSplit = new LinkedList<>(); for (int i = 0; i < textString.length(); ++i) textSplit.add(textString.substring(i, i + 1)); ListMatch<String> matcher = new RegexBasedMatch<>(pattern); for (int i : matcher.matches(textSplit)) { assertTrue(textString.substring(i).startsWith("gag")); } }
public abstract List<Integer> matches(List<T> text);
ListMatch { public abstract List<Integer> matches(List<T> text); }
ListMatch { public abstract List<Integer> matches(List<T> text); ListMatch(List<T> pattern); }
ListMatch { public abstract List<Integer> matches(List<T> text); ListMatch(List<T> pattern); abstract List<Integer> matches(List<T> text); static ListMatch<T> getMatcher(List<T> pattern); }
ListMatch { public abstract List<Integer> matches(List<T> text); ListMatch(List<T> pattern); abstract List<Integer> matches(List<T> text); static ListMatch<T> getMatcher(List<T> pattern);  }