@Test public void testLookingAt() { StringReader reader = new StringReader(REGEX_DATA); CharSequence text = new ReaderCharSequence(reader); ReaderMatcher matcher = new ReaderMatcher(REGEX_LOOKING_AT, text); matcher.region(1, text.length()); assertTrue(matcher.lookingAt()); matcher.region(2, text.length()); assertFalse(matcher.lookingAt()); }
public boolean lookingAt() { boolean result = false; try { result = matcher.lookingAt(); } catch (IndexOutOfBoundsException e) { } if (lengthChanged()) { int regionStart = matcher.regionStart(); int regionEnd = Math.min(text.length(), matcher.regionEnd()); matcher.reset(text); matcher.region(regionStart, regionEnd); result = matcher.lookingAt(); } return result; }
ReaderMatcher implements MatchResult { public boolean lookingAt() { boolean result = false; try { result = matcher.lookingAt(); } catch (IndexOutOfBoundsException e) { } if (lengthChanged()) { int regionStart = matcher.regionStart(); int regionEnd = Math.min(text.length(), matcher.regionEnd()); matcher.reset(text); matcher.region(regionStart, regionEnd); result = matcher.lookingAt(); } return result; } }
ReaderMatcher implements MatchResult { public boolean lookingAt() { boolean result = false; try { result = matcher.lookingAt(); } catch (IndexOutOfBoundsException e) { } if (lengthChanged()) { int regionStart = matcher.regionStart(); int regionEnd = Math.min(text.length(), matcher.regionEnd()); matcher.reset(text); matcher.region(regionStart, regionEnd); result = matcher.lookingAt(); } return result; } ReaderMatcher(Pattern pattern, CharSequence text); }
ReaderMatcher implements MatchResult { public boolean lookingAt() { boolean result = false; try { result = matcher.lookingAt(); } catch (IndexOutOfBoundsException e) { } if (lengthChanged()) { int regionStart = matcher.regionStart(); int regionEnd = Math.min(text.length(), matcher.regionEnd()); matcher.reset(text); matcher.region(regionStart, regionEnd); result = matcher.lookingAt(); } return result; } ReaderMatcher(Pattern pattern, CharSequence text); ReaderMatcher appendReplacement(StringBuffer sb, String replacement); StringBuffer appendTail(StringBuffer sb); int end(); int end(int group); boolean find(); boolean find(int start); String group(); String group(int group); int groupCount(); boolean hasAnchoringBounds(); boolean hasTransparentBounds(); boolean hitEnd(); boolean lookingAt(); boolean matches(); Pattern pattern(); ReaderMatcher region(int start, int end); int regionEnd(); int regionStart(); String replaceAll(String replacement); String replaceFirst(String replacement); boolean requireEnd(); ReaderMatcher reset(); ReaderMatcher reset(CharSequence input); int start(); int start(int group); MatchResult toMatchResult(); String toString(); ReaderMatcher useAnchoringBounds(boolean b); ReaderMatcher usePattern(Pattern newPattern); ReaderMatcher useTransparentBounds(boolean b); }
ReaderMatcher implements MatchResult { public boolean lookingAt() { boolean result = false; try { result = matcher.lookingAt(); } catch (IndexOutOfBoundsException e) { } if (lengthChanged()) { int regionStart = matcher.regionStart(); int regionEnd = Math.min(text.length(), matcher.regionEnd()); matcher.reset(text); matcher.region(regionStart, regionEnd); result = matcher.lookingAt(); } return result; } ReaderMatcher(Pattern pattern, CharSequence text); ReaderMatcher appendReplacement(StringBuffer sb, String replacement); StringBuffer appendTail(StringBuffer sb); int end(); int end(int group); boolean find(); boolean find(int start); String group(); String group(int group); int groupCount(); boolean hasAnchoringBounds(); boolean hasTransparentBounds(); boolean hitEnd(); boolean lookingAt(); boolean matches(); Pattern pattern(); ReaderMatcher region(int start, int end); int regionEnd(); int regionStart(); String replaceAll(String replacement); String replaceFirst(String replacement); boolean requireEnd(); ReaderMatcher reset(); ReaderMatcher reset(CharSequence input); int start(); int start(int group); MatchResult toMatchResult(); String toString(); ReaderMatcher useAnchoringBounds(boolean b); ReaderMatcher usePattern(Pattern newPattern); ReaderMatcher useTransparentBounds(boolean b);  }