All Packages Class Hierarchy This Package Previous Next Index
Class duckMachine.operatingSystem.VisitorFile
java.lang.Object
|
+----duckMachine.operatingSystem.VisitorFile
- public class VisitorFile
- extends Object
Operations on visitor files. These use the reflections capabilities
of Java to convert the name of a class to an object of that type.
-
VisitorFile(String)
- The string argument is supposed to be the name of a file containing
a visitor definition.
-
makeVisitor(MachineI)
- Creates a visitor object.
VisitorFile
public VisitorFile(String f) throws VisitorFileE
- The string argument is supposed to be the name of a file containing
a visitor definition. We convert the filename to a class name and
then attempt to load the class using the forName method.
- Throws: VisitorFileE
- If the file is not found.
- See Also:
- forName
makeVisitor
public InsVisitor makeVisitor(MachineI mach) throws VisitorFileE
- Creates a visitor object. First we try to find a constructor
that accepts MachineI objects since every legal visitor should
have such a constructor. Next we use that constructor to
create a visitor object and return it.
- Throws: VisitorFileE
- If the file is not a visitor file or
a constructor with the right signature cannot be accessed.
All Packages Class Hierarchy This Package Previous Next Index