org.hecl
Class SubstThing

java.lang.Object
  extended by org.hecl.SubstThing
All Implemented Interfaces:
RealThing

public class SubstThing
extends java.lang.Object
implements RealThing

The SubstThing class represents things that must be substituted - $foo or &foo for example.

Version:
1.0
Author:
David N. Welton

Field Summary
 long cacheversion
           
 
Constructor Summary
SubstThing()
           
SubstThing(java.lang.String s)
          Creates a new SubstThing instance from a string, which is the variable name to reference.
 
Method Summary
 RealThing deepcopy()
          deepcopy returns a copy of the SubstThing.
static Thing get(Interp interp, Thing thing)
          get returns the *value* of a SubstThing - in other words, the Thing that its varName is pointing to.
 java.lang.String getStringRep()
          getStringRep returns a string representation of the SubstThing.
 java.lang.String thingclass()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cacheversion

public long cacheversion
Constructor Detail

SubstThing

public SubstThing()

SubstThing

public SubstThing(java.lang.String s)
Creates a new SubstThing instance from a string, which is the variable name to reference.

Parameters:
s - a String value
Method Detail

thingclass

public java.lang.String thingclass()
Specified by:
thingclass in interface RealThing

get

public static Thing get(Interp interp,
                        Thing thing)
                 throws HeclException
get returns the *value* of a SubstThing - in other words, the Thing that its varName is pointing to. We use a cacheing mechanism devised by Salvatore Sanfilippo to avoid unnecessary lookups.

Parameters:
interp - an Interp value
thing - a Thing value
Returns:
a Thing value
Throws:
HeclException - if an error occurs

deepcopy

public RealThing deepcopy()
deepcopy returns a copy of the SubstThing.

Specified by:
deepcopy in interface RealThing
Returns:
a RealThing value

getStringRep

public java.lang.String getStringRep()
getStringRep returns a string representation of the SubstThing.

Specified by:
getStringRep in interface RealThing
Returns:
a String value