@Test @DisplayName("Can't remove range if start is out of bounds.") void removeRangeThrowsExceptionWhenStartOutOfBounds() { final var source = new TestSource("public final"); try(final var sut = new JavaLexed(source)) { Assertions.assertThrows(IndexOutOfBoundsException.class, () -> sut.removeRange(-1, 2)); } }
public void removeRange(int start, int end) { assertStartEndOrder(start, end); assertOpen(); if (end > start) { lexicalElements.subList(start, end).clear(); } }
JavaLexed implements AutoCloseable { public void removeRange(int start, int end) { assertStartEndOrder(start, end); assertOpen(); if (end > start) { lexicalElements.subList(start, end).clear(); } } }
JavaLexed implements AutoCloseable { public void removeRange(int start, int end) { assertStartEndOrder(start, end); assertOpen(); if (end > start) { lexicalElements.subList(start, end).clear(); } } JavaLexed(Source source); }
JavaLexed implements AutoCloseable { public void removeRange(int start, int end) { assertStartEndOrder(start, end); assertOpen(); if (end > start) { lexicalElements.subList(start, end).clear(); } } JavaLexed(Source source); @Override void close(); Iterable<LexicalElement> lexicalElements(); LexicalElement get(int i); LexicalElement remove(int i); void removeRange(int start, int end); int replaceWith(List<LexicalElement>... lists); int replace(MatchResult result, List<LexicalElement>... lists); int replace(int start, int end, List<LexicalElement>... lists); void add(int index, LexicalElement le); int size(); JavaLexed match(BiFunction<JavaLexed, Lexpression, LexMatcher> expression); JavaLexed find(BiFunction<JavaLexed, Lexpression, LexMatcher> expression); JavaLexed sensitivity(int sensitivity); JavaLexed fromStart(); JavaLexed fromIndex(int i); Optional<java.util.regex.MatchResult> regexGroups(final String name); List<javax0.geci.javacomparator.LexicalElement> group(final String name); MatchResult result(); }
JavaLexed implements AutoCloseable { public void removeRange(int start, int end) { assertStartEndOrder(start, end); assertOpen(); if (end > start) { lexicalElements.subList(start, end).clear(); } } JavaLexed(Source source); @Override void close(); Iterable<LexicalElement> lexicalElements(); LexicalElement get(int i); LexicalElement remove(int i); void removeRange(int start, int end); int replaceWith(List<LexicalElement>... lists); int replace(MatchResult result, List<LexicalElement>... lists); int replace(int start, int end, List<LexicalElement>... lists); void add(int index, LexicalElement le); int size(); JavaLexed match(BiFunction<JavaLexed, Lexpression, LexMatcher> expression); JavaLexed find(BiFunction<JavaLexed, Lexpression, LexMatcher> expression); JavaLexed sensitivity(int sensitivity); JavaLexed fromStart(); JavaLexed fromIndex(int i); Optional<java.util.regex.MatchResult> regexGroups(final String name); List<javax0.geci.javacomparator.LexicalElement> group(final String name); MatchResult result();  }