org.overlord.sramp.common.query.xpath
Class Token

java.lang.Object
  extended by org.overlord.sramp.common.query.xpath.Token

public final class Token
extends Object

A single token in the token stream. Every token has a String value and a token type.

Author:
eric.wittmann@redhat.com

Constructor Summary
Token(TokenType type, String value)
          Constructor.
 
Method Summary
 TokenType getType()
           
 String getValue()
           
 boolean matches(String... values)
          Returns true if this token's value matches any of the values provided.
 boolean matches(TokenType... tokenTypes)
          Returns true if this token's type matches any of the token types provided.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Token

public Token(TokenType type,
             String value)
Constructor.

Parameters:
type -
value -
Method Detail

getType

public TokenType getType()
Returns:
the type

getValue

public String getValue()
Returns:
the value

matches

public boolean matches(String... values)
Returns true if this token's value matches any of the values provided.

Parameters:
values -

matches

public boolean matches(TokenType... tokenTypes)
Returns true if this token's type matches any of the token types provided.

Parameters:
tokenTypes -

toString

public String toString()
Overrides:
toString in class Object
See Also:
Object.toString()


Copyright © 2011-2013 JBoss, a division of Red Hat. All Rights Reserved.