org.hecl
Class Thing
- java.lang.Object
-
- org.hecl.Thing
-
public class Thing extends java.lang.ObjectTheThingclass is what Hecl revolves around. "Things" can be of several types, include strings, integers, lists, hash tables.
-
-
Field Summary
Fields Modifier and Type Field and Description booleanglobalstatic java.util.Vectorreferencesstatic longthingcounter
-
Constructor Summary
Constructors Constructor and Description Thing(RealThing realthing)Creates a newThinginstance from an internal representation.Thing(java.lang.String s)Creates a newThinginstance from a string.Thing(java.lang.StringBuffer s)Creates a newThinginstance from a string buffer.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description Thingdeepcopy()deepcopycopies the thing, its value, and any elements the value might contain.static ThingemptyThing()booleanequals(java.lang.Object obj)Theequalsmethod overrides the object equals method, using either the two objects, in the case of two ObjectThings, or the two string representations.RealThinggetVal()getValfetches the internal value of the Thing.inthashCode()ThehashCodemethod overrides the object hashCode method, using the hash of the string representation.booleanisLiteral()static booleanisTrue(Thing thing)isTrueis a convenience function that lets us know if the result of a calculation is true or false.voidmakeref(Thing newval)makerefsets the 'this' Thing to be a reference to the newval that was passed to it.voidsetCopyVal(RealThing realthing)ThingsetLiteral()ThesetLiteralmethod sets the thing in question to be a literal Thing, and returns it.voidsetVal(RealThing realthing)setValsets the internal representation of the Thing.java.lang.StringtoString()toStringreturns the String value of a Thing.
-
-
-
Field Detail
-
global
public boolean global
-
thingcounter
public static long thingcounter
-
references
public static java.util.Vector references
-
-
Constructor Detail
-
Thing
public Thing(java.lang.String s)
Creates a newThinginstance from a string.- Parameters:
s- aStringvalue
-
Thing
public Thing(java.lang.StringBuffer s)
Creates a newThinginstance from a string buffer.- Parameters:
s- aStringBuffervalue
-
Thing
public Thing(RealThing realthing)
Creates a newThinginstance from an internal representation.- Parameters:
realthing- aRealThingvalue
-
-
Method Detail
-
setVal
public void setVal(RealThing realthing)
setValsets the internal representation of the Thing.- Parameters:
realthing- aRealThingvalue
-
setCopyVal
public void setCopyVal(RealThing realthing)
-
getVal
public RealThing getVal()
getValfetches the internal value of the Thing.- Returns:
- a
RealThingvalue
-
emptyThing
public static final Thing emptyThing()
-
isTrue
public static boolean isTrue(Thing thing) throws HeclException
isTrueis a convenience function that lets us know if the result of a calculation is true or false.- Parameters:
thing- aThingvalue- Returns:
- a
booleanvalue - Throws:
HeclException- if an error occurs
-
makeref
public void makeref(Thing newval)
makerefsets the 'this' Thing to be a reference to the newval that was passed to it.- Parameters:
newval- aThingvalue.
-
toString
public java.lang.String toString()
toStringreturns the String value of a Thing.- Overrides:
toStringin classjava.lang.Object- Returns:
- a
Stringvalue
-
hashCode
public int hashCode()
ThehashCodemethod overrides the object hashCode method, using the hash of the string representation.- Overrides:
hashCodein classjava.lang.Object- Returns:
- an
intvalue
-
equals
public boolean equals(java.lang.Object obj)
Theequalsmethod overrides the object equals method, using either the two objects, in the case of two ObjectThings, or the two string representations.- Overrides:
equalsin classjava.lang.Object- Parameters:
obj- anObjectvalue- Returns:
- a
booleanvalue
-
setLiteral
public Thing setLiteral()
ThesetLiteralmethod sets the thing in question to be a literal Thing, and returns it.- Returns:
- a
Thingvalue
-
isLiteral
public boolean isLiteral()
-
deepcopy
public Thing deepcopy() throws HeclException
deepcopycopies the thing, its value, and any elements the value might contain.- Returns:
- a
Thingvalue - Throws:
HeclException
-
-
DataMelt 3.0 © DataMelt by jWork.ORG