jigcell.compare.transform
Class Transform

java.lang.Object
  extended by javax.swing.TransferHandler
      extended by jigcell.compare.impl.Transferer
          extended by jigcell.compare.impl.DataSource
              extended by jigcell.compare.data.DataGenerator
                  extended by jigcell.compare.data.EditableDataGenerator
                      extended by jigcell.compare.data.ProgrammableDataGenerator
                          extended by jigcell.compare.transform.Transform
All Implemented Interfaces:
java.awt.datatransfer.Transferable, java.beans.PropertyChangeListener, java.io.Serializable, java.lang.Cloneable, java.util.EventListener, IDataGenerator, IDataSource, IEditableDataGenerator, IProgrammableDataGenerator, IReadableDataSource, IWriteableDataSource, ITransform
Direct Known Subclasses:
ConstantTransform, ExtremaTestTransform, FileTransform, GenericScanTransform, InputTransform, JigCellRunManagerTransform, MethodDispatcherTests.DispatchedTransform, ScriptEvaluationTransform, SelectColumnsTransform, TransformContainer, TransformEvaluationTransform, TransformHelper, WildtypeScanTransform

public abstract class Transform
extends ProgrammableDataGenerator
implements ITransform

An indvidual statement of a transform as a part of a sequence of steps.

This code is licensed under the DARPA BioCOMP Open Source License. See LICENSE for more details.

Author:
Nicholas Allen
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class jigcell.compare.data.EditableDataGenerator
EditableDataGenerator.EditableDataGeneratorDelegate
 
Nested classes/interfaces inherited from interface jigcell.compare.IDataSource
IDataSource.Option
 
Field Summary
protected  boolean allowContextInsertion
          Whether transforms can be inserted around this transform through a context menu
protected  boolean allowContextRemoval
          Whether this transform can be removed through a context menu
protected  ITransformContainer container
          Transform container
protected  ITransformContext context
          Context for performing evaluations
 
Fields inherited from class jigcell.compare.data.ProgrammableDataGenerator
allowDescriptionQuery, callStack, listenerList
 
Fields inherited from class jigcell.compare.data.DataGenerator
COMPARATOR_NAME, DESCRIPTION_READ, SEPARATOR_ESCAPE, SPECIAL_CHARS
 
Fields inherited from class jigcell.compare.impl.DataSource
OPTIONS_LOCK, SEPARATOR_PAIR, SEPARATOR_PART, SEPARATORS
 
Fields inherited from class jigcell.compare.impl.Transferer
CSV_FOOTER, CSV_LINEPOSTPEND, CSV_LINEPREPEND, CSV_LINESEPARATOR, HTML_FOOTER, HTML_HEADPOSTPEND, HTML_HEADPREPEND, HTML_HEADSEPARATOR, HTML_LINEPOSTPEND, HTML_LINEPREPEND, HTML_LINESEPARATOR
 
Fields inherited from class javax.swing.TransferHandler
COPY, COPY_OR_MOVE, MOVE, NONE
 
Fields inherited from interface jigcell.compare.transform.ITransform
OPTION_ANNOTATION, OPTION_COMPATIBLE, OPTION_NEXTSTATEMENT, OPTION_PREVIOUSSTATEMENT, OPTION_TRANSFORM, PROPERTY_TRANSFORM_EDIT, RESOURCE_TRANSFORMS
 
Fields inherited from interface jigcell.compare.IProgrammableDataGenerator
METHOD_GENERATE, OPTION_COMPARE, OPTION_INPUTTYPECHECKER, OPTION_OUTPUTTYPECHECKER
 
Fields inherited from interface jigcell.compare.IDataGenerator
ATTRIBUTE_COMMENT, ATTRIBUTE_GUID, PROPERTY_GENERATOR_EDIT, RESOURCE_GENERATORS
 
Fields inherited from interface jigcell.compare.IReadableDataSource
OPTION_READDESCRIPTION, OPTION_READICON
 
Fields inherited from interface jigcell.compare.IDataSource
OPTION_NAME
 
Fields inherited from interface jigcell.compare.IWriteableDataSource
OPTION_WRITEDESCRIPTION, OPTION_WRITEICON
 
Constructor Summary
Transform()
          Creates a new transform.
 
Method Summary
 void clear()
          Nulls out the stored element.
protected  void copy(boolean shallow, IDataGenerator target)
          Copies state for this generator.
protected  IDataElement evaluate()
          Evaluates the associated element.
protected  IDataElement evaluate(IDataElement input)
          Evaluates the transform.
 void flush()
          Destroys all work leading into this generator.
 boolean getAllowContextInsertion()
          Whether this transform allows insertions through the context menu.
 boolean getAllowContextRemoval()
          Whether this transform allows removals through the context menu.
 ITransformAnnotation getAnnotation()
          An annotation object for this generator.
 IDataGeneratorList getCompatibleTransforms()
          The transforms compatible with this statement.
 ITransformContainer getContainer()
          The container of this transform.
 IDataGeneratorList getDependencies()
          The dependencies of this transform.
 ITransformContext getEvaluationContext()
          The runtime context for performing an evaluation.
 ITransform getNextStatement()
          The next generator in the sequence of transforms.
protected  IDataElement getPreviousElement()
          Data element that should be used in evaluation.
 ITransform getPreviousStatement()
          The previous generator in the sequence of transforms.
protected  ITransform getSource()
          The data source that should be used as the previous computation value.
static ITransform getTransformForGenerator(IDataGenerator generator)
          The transform of a generator.
 boolean hasNextStatement()
          Whether this transform has a next statement.
 boolean hasPreviousStatement()
          Whether this transform has a previous statement.
protected  void initializeSource()
          Performs any initialization work for the view that must be duplicated for each new instance. This method is called exactly once and only during object construction.
 boolean isReorderable()
          Whether the evaluation of this transform has no indirect dependencies.
 boolean isRunnable()
          Whether this transform can be executed.
 void setAllowContextInsertion(boolean allowContextInsertion)
          Sets whether this transform allows insertions through the context menu.
 void setAllowContextRemoval(boolean allowContextRemoval)
          Sets whether this transform allows removals through the context menu.
protected  void setAnnotation(ITransformAnnotation annotation)
          Sets the annotation data for this transform.
 void setCompatibleTransforms(IDataGeneratorList transforms)
          Sets the transforms compatible with this statement.
 void setContainer(ITransformContainer container)
          Sets the container of this transform.
 void setEvaluationContext(ITransformContext context)
          Sets the runtime context for performing an evaluation.
 void setNextStatement(ITransform generator)
          The next generator in the sequence of transforms.
 void setPreviousStatement(ITransform generator)
          Sets the previous generator in the sequence of transforms.
 
Methods inherited from class jigcell.compare.data.ProgrammableDataGenerator
addEvaluationListener, createCustomizer, fireEvaluationError, fireEvaluationError, fireEvaluationStart, fireEvaluationStop, getAllowDescriptionQuery, getCallStack, getElement, getElement, getEvaluationLock, getInputTypeChecker, getInterface, getOutputTypeChecker, isCached, peekElement, peekInterface, propertyChange, removeEvaluationListener, setAllowDescriptionQuery, setInputTypeChecker, setInterfaceClass, setOutputTypeChecker, updateInterface
 
Methods inherited from class jigcell.compare.data.EditableDataGenerator
getPredictedCompatibility, getPredictedCompatibility, isSet, setAttribute, setComment, setElement, setElement, setOption, setState, write
 
Methods inherited from class jigcell.compare.data.DataGenerator
clone, compareByName, copy, generateGUID, getAttribute, getComment, getCopiedFrom, getName, getPredictedContents, getTransferData, isCopy, isCopyRelated, read, setCopyName, setName, toString
 
Methods inherited from class jigcell.compare.impl.DataSource
addOption, addPropertyChangeListener, addPropertyChangeListener, configure, getOption, getOptions, getOptionType, getPropertyChangeListeners, getPropertyChangeListeners, getReadDescriptionOption, getReadIconOption, getState, getWriteDescriptionOption, getWriteIconOption, persistSource, removePropertyChangeListener, removePropertyChangeListener, setOptions, setOptionType, setReadDescriptionOption, setReadIconOption, setWriteDescriptionOption, setWriteIconOption, unpersistSource
 
Methods inherited from class jigcell.compare.impl.Transferer
addExtension, addFlavor, createCSVTable, createFormattedTable, createHTMLTable, getExceptionRecorder, getExpectedClasses, getExpectedClasses, getExpectedClasses, getFlavors, getFlavors, getPreferredExtensions, getPreferredExtensions, getTransferClass, getTransferDataFlavors, getTransferFlavor, isDataFlavorSupported, transfer
 
Methods inherited from class javax.swing.TransferHandler
canImport, createTransferable, exportAsDrag, exportDone, exportToClipboard, getCopyAction, getCutAction, getPasteAction, getSourceActions, getVisualRepresentation, importData
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface jigcell.compare.IProgrammableDataGenerator
addEvaluationListener, getCallStack, getElement, getEvaluationLock, getInputTypeChecker, getInterface, getOutputTypeChecker, peekElement, removeEvaluationListener
 
Methods inherited from interface jigcell.compare.IEditableDataGenerator
setComment, setCopyName, setElement, setName
 
Methods inherited from interface jigcell.compare.IDataGenerator
copy, getAttribute, getComment, getCopiedFrom, getElement, isCached, isCopy, isCopyRelated, setAttribute
 
Methods inherited from interface jigcell.compare.IReadableDataSource
getPredictedContents, getReadDescriptionOption, getReadIconOption, read, setReadDescriptionOption, setReadIconOption
 
Methods inherited from interface jigcell.compare.IDataSource
addOption, clone, configure, getName, getOption, getState, setOption, setState
 
Methods inherited from interface java.awt.datatransfer.Transferable
getTransferData, getTransferDataFlavors, isDataFlavorSupported
 
Methods inherited from interface jigcell.compare.IWriteableDataSource
getPredictedCompatibility, getPredictedCompatibility, getWriteDescriptionOption, getWriteIconOption, setWriteDescriptionOption, setWriteIconOption, write
 

Field Detail

allowContextInsertion

protected boolean allowContextInsertion
Whether transforms can be inserted around this transform through a context menu


allowContextRemoval

protected boolean allowContextRemoval
Whether this transform can be removed through a context menu


container

protected ITransformContainer container
Transform container


context

protected transient ITransformContext context
Context for performing evaluations

Constructor Detail

Transform

public Transform()
Creates a new transform.

Method Detail

getTransformForGenerator

public static ITransform getTransformForGenerator(IDataGenerator generator)
The transform of a generator.

Parameters:
generator - Generator

clear

public void clear()
Nulls out the stored element.

Specified by:
clear in interface IEditableDataGenerator
Specified by:
clear in interface ITransform
Overrides:
clear in class ProgrammableDataGenerator

flush

public void flush()
Destroys all work leading into this generator.

Specified by:
flush in interface ITransform

getAllowContextInsertion

public boolean getAllowContextInsertion()
Whether this transform allows insertions through the context menu.


getAllowContextRemoval

public boolean getAllowContextRemoval()
Whether this transform allows removals through the context menu.


getAnnotation

public ITransformAnnotation getAnnotation()
An annotation object for this generator.

Specified by:
getAnnotation in interface ITransform

getCompatibleTransforms

public IDataGeneratorList getCompatibleTransforms()
The transforms compatible with this statement.

Specified by:
getCompatibleTransforms in interface ITransform

getContainer

public ITransformContainer getContainer()
The container of this transform.

Specified by:
getContainer in interface ITransform

getDependencies

public IDataGeneratorList getDependencies()
The dependencies of this transform. Additionally, a transform is considered dependent on the previous, next, children, and parent transforms. This function may return any subset of dependencies with the same transitive closure as the full set. A null result may be used to indicate that no dependencies exist.

Specified by:
getDependencies in interface ITransform

getEvaluationContext

public ITransformContext getEvaluationContext()
The runtime context for performing an evaluation.

Specified by:
getEvaluationContext in interface ITransform

getNextStatement

public ITransform getNextStatement()
The next generator in the sequence of transforms.

Specified by:
getNextStatement in interface ITransform

getPreviousStatement

public ITransform getPreviousStatement()
The previous generator in the sequence of transforms.

Specified by:
getPreviousStatement in interface ITransform

hasNextStatement

public boolean hasNextStatement()
Whether this transform has a next statement.

Specified by:
hasNextStatement in interface ITransform

hasPreviousStatement

public boolean hasPreviousStatement()
Whether this transform has a previous statement.

Specified by:
hasPreviousStatement in interface ITransform

isReorderable

public boolean isReorderable()
Whether the evaluation of this transform has no indirect dependencies.

Specified by:
isReorderable in interface ITransform

isRunnable

public boolean isRunnable()
Whether this transform can be executed.

Specified by:
isRunnable in interface ITransform

setAllowContextInsertion

public void setAllowContextInsertion(boolean allowContextInsertion)
Sets whether this transform allows insertions through the context menu.

Parameters:
allowContextInsertion - Show context menu insertion choices

setAllowContextRemoval

public void setAllowContextRemoval(boolean allowContextRemoval)
Sets whether this transform allows removals through the context menu.

Parameters:
allowContextRemoval - Show context menu removal choices

setCompatibleTransforms

public void setCompatibleTransforms(IDataGeneratorList transforms)
Sets the transforms compatible with this statement.

Specified by:
setCompatibleTransforms in interface ITransform
Parameters:
transforms - Compatible transforms

setContainer

public void setContainer(ITransformContainer container)
Sets the container of this transform.

Specified by:
setContainer in interface ITransform
Parameters:
container - Container

setEvaluationContext

public void setEvaluationContext(ITransformContext context)
Sets the runtime context for performing an evaluation.

Specified by:
setEvaluationContext in interface ITransform
Parameters:
context - Evaluation context

setNextStatement

public void setNextStatement(ITransform generator)
The next generator in the sequence of transforms.

Specified by:
setNextStatement in interface ITransform
Parameters:
generator - Next generator

setPreviousStatement

public void setPreviousStatement(ITransform generator)
Sets the previous generator in the sequence of transforms.

Specified by:
setPreviousStatement in interface ITransform
Parameters:
generator - Previous generator

copy

protected void copy(boolean shallow,
                    IDataGenerator target)
Copies state for this generator.

Overrides:
copy in class ProgrammableDataGenerator
Parameters:
shallow - Whether the copy is shallow
target - Generator to copy to

evaluate

protected IDataElement evaluate()
Evaluates the associated element.

Specified by:
evaluate in class ProgrammableDataGenerator

evaluate

protected IDataElement evaluate(IDataElement input)
Evaluates the transform.

Parameters:
input - Transform input

getPreviousElement

protected IDataElement getPreviousElement()
Data element that should be used in evaluation.


getSource

protected ITransform getSource()
The data source that should be used as the previous computation value.


initializeSource

protected void initializeSource()
Performs any initialization work for the view that must be duplicated for each new instance. This method is called exactly once and only during object construction.

Overrides:
initializeSource in class ProgrammableDataGenerator

setAnnotation

protected void setAnnotation(ITransformAnnotation annotation)
Sets the annotation data for this transform.

Parameters:
annotation - Annotation