@Test public void matches() { CharacterReader r = new CharacterReader("One Two Three"); assertTrue(r.matches('O')); assertTrue(r.matches("One Two Three")); assertTrue(r.matches("One")); assertFalse(r.matches("one")); assertEquals('O', r.consume()); assertFalse(r.matches("One")); assertTrue(r.matches("ne Two Three")); assertFalse(r.matches("ne Two Three Four")); assertEquals("ne Two Three", r.consumeToEnd()); assertFalse(r.matches("ne")); assertTrue(r.isEmpty()); }
boolean matches(char c) { return !isEmpty() && charBuf[bufPos] == c; }
CharacterReader { boolean matches(char c) { return !isEmpty() && charBuf[bufPos] == c; } }
CharacterReader { boolean matches(char c) { return !isEmpty() && charBuf[bufPos] == c; } CharacterReader(Reader input, int sz);  CharacterReader(Reader input);  CharacterReader(String input); }
CharacterReader { boolean matches(char c) { return !isEmpty() && charBuf[bufPos] == c; } CharacterReader(Reader input, int sz);  CharacterReader(Reader input);  CharacterReader(String input); int pos(); boolean isEmpty(); char current(); void advance(); String consumeTo(char c); String consumeToAny(final char... chars); @Override String toString(); }
CharacterReader { boolean matches(char c) { return !isEmpty() && charBuf[bufPos] == c; } CharacterReader(Reader input, int sz);  CharacterReader(Reader input);  CharacterReader(String input); int pos(); boolean isEmpty(); char current(); void advance(); String consumeTo(char c); String consumeToAny(final char... chars); @Override String toString();  }