jigcell.compare.objective
Class MetricObjective

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.objective.Objective
                              extended by jigcell.compare.objective.MetricObjective
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, IObjective

public class MetricObjective
extends Objective

A FunctionalDataGenerator whose function is based upon a metric.

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
protected static class MetricObjective.MetricObjectiveDelegate
          Uses the copy method to replicate the chain of creation.
 
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 static java.lang.String OPTION_METRIC
          Option for the metric this generator uses
 
Fields inherited from class jigcell.compare.objective.Objective
ERROR, OPTION_DATA, OPTION_FUNCTION
 
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.objective.IObjective
OPTION_OBJECTIVE, PROPERTY_OBJECTIVE_EDIT, RESOURCE_OBJECTIVES
 
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
MetricObjective()
          Creates a new data generator based upon a metric evaluation.
 
Method Summary
protected  void copy(boolean shallow, IDataGenerator target)
          Copies state for this generator.
protected  IDataElement evaluate()
          Evaluates the associated element.
 ITypeChecker getInputTypeChecker()
          Type checker that can validate the input to this generator.
 IObjective getMetric()
          The distance metric.
 void setMetric(IObjective metric)
          Sets the distance metric.
 
Methods inherited from class jigcell.compare.objective.Objective
evaluate, getData, getFunction, getObjectiveForGenerator, setData, setFunction
 
Methods inherited from class jigcell.compare.data.ProgrammableDataGenerator
addEvaluationListener, clear, createCustomizer, fireEvaluationError, fireEvaluationError, fireEvaluationStart, fireEvaluationStop, getAllowDescriptionQuery, getCallStack, getElement, getElement, getEvaluationLock, getInterface, getOutputTypeChecker, initializeSource, 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.objective.IObjective
clear
 
Methods inherited from interface jigcell.compare.IProgrammableDataGenerator
addEvaluationListener, getCallStack, getElement, getEvaluationLock, 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

OPTION_METRIC

protected static final java.lang.String OPTION_METRIC
Option for the metric this generator uses

See Also:
Constant Field Values
Constructor Detail

MetricObjective

public MetricObjective()
Creates a new data generator based upon a metric evaluation.

Method Detail

getInputTypeChecker

public ITypeChecker getInputTypeChecker()
Type checker that can validate the input to this generator.

Specified by:
getInputTypeChecker in interface IProgrammableDataGenerator
Overrides:
getInputTypeChecker in class ProgrammableDataGenerator

getMetric

public IObjective getMetric()
The distance metric.


setMetric

public void setMetric(IObjective metric)
Sets the distance metric. A cyclical dependency of generators is illegal.

Parameters:
metric - Distance metric

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.

Overrides:
evaluate in class Objective