Building Parsers with Java

sjm.examples.string
Class Identity

java.lang.Object
  |
  +--sjm.examples.string.StringFunction
        |
        +--sjm.examples.string.Identity

public class Identity
extends StringFunction

An Identity function returns the input string unchanged, in response to the f() method. This allows other classes to always expect a source function to wrap their functions around.


Fields inherited from class sjm.examples.string.StringFunction
source
 
Constructor Summary
Identity()
          Construct an identity function.
 
Method Summary
 java.lang.String f(java.lang.String s)
          Return the given string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Identity

public Identity()
Construct an identity function.
Method Detail

f

public java.lang.String f(java.lang.String s)
Return the given string.
Overrides:
f in class StringFunction

by Steve Metsker