org.hecl
Class HashThing
- java.lang.Object
-
- org.hecl.HashThing
-
-
Constructor Summary
Constructors Constructor and Description HashThing()Creates a new, emptyHashThinginstance.HashThing(java.util.Hashtable h)Creates a newHashThinginstance from a Hashtable.HashThing(java.util.Vector v)Creates a newHashThinginstance from a Vector.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description static Thingcreate(java.util.Hashtable h)createallocates and returns a new HashThing typed Thing.RealThingdeepcopy()deepcopycopies the hash table and all its elements.static java.util.Hashtableget(Thing thing)getattempts to return a Hashtable from a given Thing, in the process transforming that Thing into a HashThing internally.java.lang.StringgetStringRep()getStringRepreturns a string representation of a HashThing, which is in reality a string representation of a ListThing, only that there are guaranteed to be an even number of elements.java.lang.Stringthingclass()
-
-
-
Constructor Detail
-
HashThing
public HashThing()
Creates a new, emptyHashThinginstance.
-
HashThing
public HashThing(java.util.Hashtable h)
Creates a newHashThinginstance from a Hashtable.- Parameters:
h- aHashtablevalue
-
HashThing
public HashThing(java.util.Vector v) throws HeclExceptionCreates a newHashThinginstance from a Vector. This may throw an exception, because if the Vector doesn't have an even number of elements, it won't be a valid hash table.- Parameters:
v- aVectorvalue- Throws:
HeclException- if an error occurs
-
-
Method Detail
-
thingclass
public java.lang.String thingclass()
- Specified by:
thingclassin interfaceRealThing
-
create
public static Thing create(java.util.Hashtable h)
createallocates and returns a new HashThing typed Thing.- Parameters:
h- aHashtablevalue- Returns:
- a
Thingvalue
-
get
public static java.util.Hashtable get(Thing thing) throws HeclException
getattempts to return a Hashtable from a given Thing, in the process transforming that Thing into a HashThing internally.- Parameters:
thing- aThingvalue- Returns:
- a
Hashtablevalue - Throws:
HeclException- if an error occurs
-
deepcopy
public RealThing deepcopy() throws HeclException
deepcopycopies the hash table and all its elements.- Specified by:
deepcopyin interfaceRealThing- Returns:
- a
RealThingvalue - Throws:
HeclException
-
getStringRep
public java.lang.String getStringRep()
getStringRepreturns a string representation of a HashThing, which is in reality a string representation of a ListThing, only that there are guaranteed to be an even number of elements.- Specified by:
getStringRepin interfaceRealThing- Returns:
- a
Stringvalue
-
-
DataMelt 3.0 © DataMelt by jWork.ORG