org.parboiled.matchers
Class CharMatcher

java.lang.Object
  extended by org.parboiled.trees.ImmutableGraphNode<Matcher>
      extended by org.parboiled.matchers.AbstractMatcher
          extended by org.parboiled.matchers.CharMatcher
All Implemented Interfaces:
java.lang.Cloneable, Matcher, Rule, GraphNode<Matcher>

public class CharMatcher
extends AbstractMatcher

A Matcher matching a single given character.


Field Summary
 char character
           
 
Constructor Summary
CharMatcher(char character)
           
 
Method Summary
<R> R
accept(MatcherVisitor<R> visitor)
          Accepts the given matcher visitor.
 boolean match(MatcherContext context)
          Tries a match on the given MatcherContext.
 
Methods inherited from class org.parboiled.matchers.AbstractMatcher
areMismatchesMemoed, areSubnodesSuppressed, getLabel, getSubContext, getTag, hasCustomLabel, isNodeSkipped, isNodeSuppressed, label, memoMismatches, setTag, skipNode, suppressNode, suppressSubnodes, toString
 
Methods inherited from class org.parboiled.trees.ImmutableGraphNode
getChildren
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.parboiled.trees.GraphNode
getChildren
 

Field Detail

character

public final char character
Constructor Detail

CharMatcher

public CharMatcher(char character)
Method Detail

match

public boolean match(MatcherContext context)
Description copied from interface: Matcher
Tries a match on the given MatcherContext.

Parameters:
context - the MatcherContext
Returns:
true if the match was successful

accept

public <R> R accept(MatcherVisitor<R> visitor)
Description copied from interface: Matcher
Accepts the given matcher visitor.

Parameters:
visitor - the visitor
Returns:
the value returned by the given visitor