Building Parsers with Java

sjm.examples.sling
Class T

java.lang.Object
  |
  +--sjm.examples.sling.SlingFunction
        |
        +--sjm.examples.sling.T

public class T
extends SlingFunction

This class represents time, which the Sling environment defines to vary from 0 to 1 as a plot unfolds.


Fields inherited from class sjm.examples.sling.SlingFunction
source
 
Constructor Summary
T()
           
 
Method Summary
 Point f(double t)
          Returns the given time
 java.lang.String toString()
          Returns a string representation of the time function.
 
Methods inherited from class sjm.examples.sling.SlingFunction
eval, extrema, fresh
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

T

public T()
Method Detail

f

public Point f(double t)
Returns the given time
Overrides:
f in class SlingFunction
Parameters:
t - a number that represents how far along a plot is, and thus tells which point to return
Returns:
the given time, placing it in the y component, and augmenting a point with time also in the x component. The point returned is (t, t).

toString

public java.lang.String toString()
Returns a string representation of the time function.
Overrides:
toString in class java.lang.Object

by Steve Metsker