Building Parsers with Java

sjm.examples.string
Class Trim

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

public class Trim
extends StringFunction

This class wraps a trim function around an instance of another StringFunction class.


Fields inherited from class sjm.examples.string.StringFunction
source
 
Constructor Summary
Trim()
          Construct a Trim function around the identity function, so that this object will just trim a supplied string.
Trim(StringFunction source)
          Construct a Trim function that will wrap itself around the supplied source.
 
Method Summary
 java.lang.String f(java.lang.String s)
          Return a trimmed version of the value of source.f(s), where s is the supplied string, and source is this function's source function.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Trim

public Trim()
Construct a Trim function around the identity function, so that this object will just trim a supplied string.

Trim

public Trim(StringFunction source)
Construct a Trim function that will wrap itself around the supplied source.
Method Detail

f

public java.lang.String f(java.lang.String s)
Return a trimmed version of the value of source.f(s), where s is the supplied string, and source is this function's source function.
Overrides:
f in class StringFunction

by Steve Metsker