|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.hecl.Thing
public class Thing
The Thing
class is what Hecl revolves around. "Things"
can be of several types, include strings, integers, lists, hash
tables.
Field Summary | |
---|---|
protected boolean |
copy
|
boolean |
global
|
protected boolean |
literal
literal is used to indicate Things which come
directly from the parser and thus should not be changed. |
Constructor Summary | |
---|---|
Thing(RealThing realthing)
Creates a new Thing instance from an internal
representation. |
|
Thing(java.lang.String s)
Creates a new Thing instance from a string. |
|
Thing(java.lang.StringBuffer s)
Creates a new Thing instance from a string buffer. |
Method Summary | |
---|---|
Thing |
deepcopy()
deepcopy copies the thing, its value, and any elements the
value might contain. |
static Thing |
emptyThing()
|
boolean |
equals(java.lang.Object obj)
The equals method overrides the object equals
method, using either the two objects, in the case of two
ObjectThings, or the two string representations. |
RealThing |
getVal()
getVal fetches the internal value of the Thing. |
int |
hashCode()
The hashCode method overrides the object hashCode
method, using the hash of the string representation. |
boolean |
isLiteral()
|
static boolean |
isTrue(Thing thing)
isTrue is a convenience function that lets us know if the
result of a calculation is true or false. |
void |
makeref(Thing newval)
makeref sets the 'this' Thing to be a reference to the
newval that was passed to it. |
void |
setCopyVal(RealThing realthing)
|
Thing |
setLiteral()
The setLiteral method sets the thing in question
to be a literal Thing, and returns it. |
void |
setVal(RealThing realthing)
setVal sets the internal representation of the Thing. |
java.lang.String |
toString()
toString returns the String value of a Thing. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected boolean copy
protected boolean literal
literal
is used to indicate Things which come
directly from the parser and thus should not be changed.
public boolean global
Constructor Detail |
---|
public Thing(java.lang.String s)
Thing
instance from a string.
s
- a String
valuepublic Thing(java.lang.StringBuffer s)
Thing
instance from a string buffer.
s
- a StringBuffer
valuepublic Thing(RealThing realthing)
Thing
instance from an internal
representation.
realthing
- a RealThing
valueMethod Detail |
---|
public void setVal(RealThing realthing)
setVal
sets the internal representation of the Thing.
realthing
- a RealThing
valuepublic void setCopyVal(RealThing realthing)
public RealThing getVal()
getVal
fetches the internal value of the Thing.
RealThing
valuepublic static final Thing emptyThing()
public static boolean isTrue(Thing thing) throws HeclException
isTrue
is a convenience function that lets us know if the
result of a calculation is true or false.
thing
- a Thing
value
boolean
value
HeclException
- if an error occurspublic void makeref(Thing newval)
makeref
sets the 'this' Thing to be a reference to the
newval that was passed to it.
newval
- a Thing
value.public java.lang.String toString()
toString
returns the String value of a Thing.
toString
in class java.lang.Object
String
valuepublic int hashCode()
hashCode
method overrides the object hashCode
method, using the hash of the string representation.
hashCode
in class java.lang.Object
int
valuepublic boolean equals(java.lang.Object obj)
equals
method overrides the object equals
method, using either the two objects, in the case of two
ObjectThings, or the two string representations.
equals
in class java.lang.Object
obj
- an Object
value
boolean
valuepublic Thing setLiteral()
setLiteral
method sets the thing in question
to be a literal Thing, and returns it.
Thing
valuepublic boolean isLiteral()
public Thing deepcopy() throws HeclException
deepcopy
copies the thing, its value, and any elements the
value might contain.
Thing
value
HeclException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |