List of usage examples for com.google.common.collect RangeMap remove
void remove(Range<K> range);
From source file:radsoft.syntaxhighlighter.SyntaxHighlighter.java
private static void removeMatches(RangeMap<Integer, String> matches, int start, int end) { Range<Integer> r = Range.closedOpen(start, end); matches.remove(r); }
From source file:radsoft.syntaxhighlighter.SyntaxHighlighter.java
private static void addMatch(RangeMap<Integer, String> matches, int start, int end, String styleKey) { if (styleKey == null) throw new NullPointerException("argument 'styleKey' cannot be null"); Map.Entry<Range<Integer>, String> e = matches.getEntry(start); if (e == null || start < e.getKey().lowerEndpoint()) { if (e != null) matches.remove(e.getKey()); e = matches.getEntry(end - 1);/* www. ja va 2 s .c o m*/ if (e != null) matches.remove(e.getKey()); Range<Integer> r = Range.closedOpen(start, end); matches.put(r, styleKey); } }