Next: Exceptions
Up: Hybrid-Search and Storage of
Previous: UML model of Straw
These are some of the useful functions provided (statically) within
the StrawType object.
Function
Purpose
string2Vector(...) |
Breaks apart a string representation of a class name (with an optional delimiter, ``.'' by default.).
class2Vector(...) |
Breaks apart the name of the Class object into a Vector.
vector2String(...) |
Merges a Vector into a String representation. For example: {a b C} becomes a.b.C. (the delimiter can be specified).
vector2Class(...) |
Generates a Class object for the given Vector of Strings. So {a b C} will generate a class object for a.b.C. This will generate an exception if there if Java can't find the class file for the object.
straw2Package(...) |
Generates the name of the package that holds extensions to the Straw. For example, if the argument is a.b.C, the function returns a.b.c.
getPackageOf(...) |
Returns the package that this object is part of. So if the Straw is \a.b.C}, the function returns a.b.
package2Straw(...) |
Returns the super-type of all objects in the package. For example, given \a.b.c}, the function returns a.b.C.
package2Class(...) |
Same as above, but returns the Class object rather than a String. Throws an exception if Java can't find the class for the specific Straw.
toTie(...) |
Returns the equivalent ``tie'' name for a Class or the String name of the object. For example, if the object is bale.C, the function returns: tie.C.
toTieClass(...) |
Same as above but returns a Class representations. Exceptions as above.
toValidTie(...) |
Same as above but will walk back through a Straw's hierarchy until it finds a valid (i.e. Java recognizable) Tie extension. For example, submitting needle.filetype.Postscript, will return tie.Filetype (because tie.filetype.Postscript doesn't exist). The function returns Tie if it can't do any better.
toBale(...) |
Same as toTie above but generates a bale.
toBaleClass(...) |
Same as toTieClass above but generates a bale Class.
toNeedle(...) |
Same as toTie above but generates a needle.
toNeedleClass(...) |
Same as toTieClass above but generates a needle Class.
getSupertypes(...) |
Finds all valid supertypes of a given Straw.
isValid(...) |
verify that Java can load an object with the given name.
Copyright 1998, Eytan Adar (eytan@alum.mit.edu)
|