TEMERITY

us.temerity.pipeline
Class BaseComparator

java.lang.Object
  extended by us.temerity.pipeline.Named
      extended by us.temerity.pipeline.PluginID
          extended by us.temerity.pipeline.BasePlugin
              extended by us.temerity.pipeline.BaseComparator
All Implemented Interfaces:
Serializable, Cloneable, Comparable<PluginID>, Glueable
Direct Known Subclasses:
GimpDiffComparator, GimpDiffComparator, GimpDiffComparator, GimpDiffComparator, NukeDiffComparator, ShakeDiffComparator, ShakeDiffComparator, ShakeDiffComparator, TextDiffComparator, XDiffComparator, XDiffComparator, XDiffComparator

public class BaseComparator
extends BasePlugin

The superclass of all Pipeline plugins for comparing revisions of files.

New kinds of comparators can be written by subclassing this class. Due to the way plugins are loaded and communicated between applications, any fields added to a subclass will be reinitialized when the action is stored to disk or when it is sent over the network.

While new plugin subclass versions are being modified and tested the underDevelopment method should be called in the subclasses constructor to enable the plugin to be dynamically reloaded.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class us.temerity.pipeline.BasePlugin
pDescription
 
Fields inherited from class us.temerity.pipeline.PluginID
pVendor, pVersionID
 
Fields inherited from class us.temerity.pipeline.Named
pName
 
Constructor Summary
protected BaseComparator()
          This constructor is required by the GlueDecoder to instantiate the class when encountered during the reading of GLUE format files and should not be called from user code.
protected BaseComparator(String name, VersionID vid, String vendor, String desc, String program)
          Construct with the given name, version, vendor and description.
 
Method Summary
 boolean equals(Object obj)
          Indicates whether some other object is "equal to" this one.
 PluginType getPluginType()
          Get which general type of plugin this is.
 String getProgram()
          Gets the name of the comparator executable.
 boolean ignoreExitCode()
          Whether Pipeline programs which launch Comparator plugins should ignore the exit code returned by the Subprocess created in the launch method.
 SubProcessLight launch(File fileA, File fileB, Map<String,String> env, File dir)
          Launch the comparator program (obtained with getProgram) under the given environmant to compare the two given files.
 
Methods inherited from class us.temerity.pipeline.BasePlugin
addSupport, compareTo, getDescription, getFullMessage, getPluginID, getResource, getResources, getResourceSize, getSupports, isUnderDevelopment, removeSupport, setSupports, supports, toString, underDevelopment
 
Methods inherited from class us.temerity.pipeline.PluginID
fromGlue, getVendor, getVersionID, toGlue
 
Methods inherited from class us.temerity.pipeline.Named
clone, getName
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BaseComparator

protected BaseComparator()
This constructor is required by the GlueDecoder to instantiate the class when encountered during the reading of GLUE format files and should not be called from user code.


BaseComparator

protected BaseComparator(String name,
                         VersionID vid,
                         String vendor,
                         String desc,
                         String program)
Construct with the given name, version, vendor and description.

Parameters:
name - The short name of the comparator.
vid - The comparator plugin revision number.
vendor - The name of the plugin vendor.
desc - A short description of the comparator.
program - A name of the comparator executable.
Method Detail

ignoreExitCode

public boolean ignoreExitCode()
Whether Pipeline programs which launch Comparator plugins should ignore the exit code returned by the Subprocess created in the launch method.

By default, this method always returns false. Subclasses which run 3rd party applications which always return non-zero (failure) error codes may consider overriding this method to return true to suppress bogus error messages.


getProgram

public String getProgram()
Gets the name of the comparator executable.

Automatically appends ".exe" to the program name when running under Windows.


getPluginType

public final PluginType getPluginType()
Get which general type of plugin this is.

Overrides:
getPluginType in class BasePlugin

launch

public SubProcessLight launch(File fileA,
                              File fileB,
                              Map<String,String> env,
                              File dir)
                       throws PipelineException
Launch the comparator program (obtained with getProgram) under the given environmant to compare the two given files.

The environment env consists of a table of environmental variable name/value pairs. Typically, this environment is corresponds to a Toolset.

Subclasses should override this method if more specialized behavior or different command line arguments are needed in order to launch the comparator for the given file sequence.

Parameters:
fileA - The absolute path to the first file.
fileB - The absolute path to the second file.
env - The environment under which the comparator is run.
dir - The working directory where the comparator is run.
Returns:
The controlling SubProcessLight instance.
Throws:
PipelineException - If unable to launch the comparator.
See Also:
SubProcessLight

equals

public final boolean equals(Object obj)
Indicates whether some other object is "equal to" this one.

Overrides:
equals in class BasePlugin
Parameters:
obj - The reference object with which to compare.

TEMERITY