jfun.parsec
Class IsToken

java.lang.Object
  extended by jfun.parsec.IsToken
All Implemented Interfaces:
java.io.Serializable, FromToken<Tok>

public final class IsToken
extends java.lang.Object
implements FromToken<Tok>

Tests if the token is the same token expected.

Author:
Ben Yu 2004-11-14
See Also:
Serialized Form

Method Summary
 Tok fromToken(Tok tok)
          return the token if the token is the same object that we are expecting.
static FromToken<Tok> instance(java.lang.Object t)
          Creates a FromToken instance using the given expected token t.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

fromToken

public Tok fromToken(Tok tok)
return the token if the token is the same object that we are expecting. null otherwise.

Specified by:
fromToken in interface FromToken<Tok>
Parameters:
tok - the token
Returns:
the transformed Object.

instance

public static FromToken<Tok> instance(java.lang.Object t)
Creates a FromToken instance using the given expected token t.

Parameters:
t - the expected token object.
Returns:
the FromToken instance.