All Packages Class Hierarchy This Package Previous Next Index
Class mesquite.lib.Snapshot
java.lang.Object
|
+----mesquite.lib.Snapshot
- public class Snapshot
- extends java.lang.Object
Used by modules (and sometimes other Commandables) to return commands that would restore the
module to its current state on file read-in or in other contexts (e.g., cloning a window). On saving a file, a module (currently Manage Mesquite Blocks)
recurses through the employee tree, collecting their Snapshots, and using them to compose a Mesquite block
for a NEXUS file that will return the active modules and windows to their current state.
-
Snapshot()
-
-
addLine(String)
- Add the given command to the list of commands.
-
addLine(String, MesquiteModule)
- Add the given command to the list of commands.
-
addLineIfAnythingToTell(String, MesquiteModule)
- Add command if there is any snapshot from module
-
dump()
- Dumps the snapshot to the system console
-
getCommand(int)
- Returns the given command from the list of commands.
-
getConditional(int)
- Returns whether the line is conditional on anything to tell
-
getLine(int)
- Returns the given command from the list of commands.
-
getModule(int)
- Returns the associated module from the list of commands.
-
getNumLines()
- Returns the number of lines in the snapshot.
-
getSnapshotCommands(MesquiteModule, MesquiteFile, String)
- accumulate snapshot (e.g., as for MESQUITE block of NEXUS file) beginning at the passed module, as if
writing for the file indicated.
-
incorporate(Snapshot, boolean)
- Incorporates given Snapshot into current ones, pulling in lines and modules
-
modulePresent(MesquiteModule)
- Returns whether the module is associated with some command.
Snapshot
public Snapshot()
addLine
public void addLine(java.lang.String command,
mesquite.lib.MesquiteModule module)
- Add the given command to the list of commands. This command should be one that hires an employee, and the current
module that would represent that hiring should be passed. The command passed is only the first token (command name),
not the entire command. Thus addHiringLine("setTreeDrawer", drawTreeTask) would compose a command of the sort
"setTreeDrawer 'Arc Tree';".
This allows the module saving the Nexus block to
insert immediately afterward the tell It... endTell block of commands that refer to that employee. (this is
important to avoid ambiguity of a getEmployee command that can result if more than one employee has the
same name. By placing the tell block immediately afterward, that hired employee will get the commands
appropriate to just it.
addLineIfAnythingToTell
public void addLineIfAnythingToTell(java.lang.String command,
mesquite.lib.MesquiteModule module)
- Add command if there is any snapshot from module
addLine
public void addLine(java.lang.String commandLine)
- Add the given command to the list of commands. The command should be the entire command line EXCEPT the
semicolon.
incorporate
public void incorporate(mesquite.lib.Snapshot snap,
boolean addTab)
- Incorporates given Snapshot into current ones, pulling in lines and modules
getLine
public java.lang.String getLine(int index)
- Returns the given command from the list of commands. The line returned is the fully formatted command
getCommand
public java.lang.String getCommand(int index)
- Returns the given command from the list of commands.
getModule
public mesquite.lib.MesquiteModule getModule(int index)
- Returns the associated module from the list of commands.
modulePresent
public boolean modulePresent(mesquite.lib.MesquiteModule module)
- Returns whether the module is associated with some command.
getConditional
public boolean getConditional(int index)
- Returns whether the line is conditional on anything to tell
getNumLines
public int getNumLines()
- Returns the number of lines in the snapshot.
dump
public void dump()
- Dumps the snapshot to the system console
getSnapshotCommands
public static java.lang.String getSnapshotCommands(mesquite.lib.MesquiteModule module,
mesquite.lib.MesquiteFile file,
java.lang.String spacer)
- accumulate snapshot (e.g., as for MESQUITE block of NEXUS file) beginning at the passed module, as if
writing for the file indicated. The spacer string is passed to prefix lines with tabs to give an indented organization.
A problem to be solved are dependencies among modules (especially TreeContexts). If a snapshot creating a module A needed by module B is written
after the snapshot creating module B, then module B on starting up will not find the needed module A.
All Packages Class Hierarchy This Package Previous Next Index