jigcell.compare.transform.annotation
Class TransformAnnotation

java.lang.Object
  extended by javax.swing.TransferHandler
      extended by jigcell.compare.impl.Transferer
          extended by jigcell.compare.transform.annotation.TransformAnnotation
All Implemented Interfaces:
java.awt.datatransfer.Transferable, java.io.Serializable, ITransformAnnotation

public class TransformAnnotation
extends Transferer
implements ITransformAnnotation

A default implementation of DataGeneratorAnnotation.

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
static class TransformAnnotation.AnnotationDescriptor
          A default implementation of AnnotationDescriptor.
 
Nested classes/interfaces inherited from interface jigcell.compare.transform.annotation.ITransformAnnotation
ITransformAnnotation.IAnnotationDescriptor
 
Field Summary
protected  java.util.Map descriptorMap
          Storage for annotation descriptors
protected static java.lang.Long LONG_ZERO
          Zero
protected static java.lang.Long NULL_KEY
          Hash key for non-positional elements
protected  java.util.SortedMap recordMap
          Storage for annotation records
protected  java.util.SortedMap valueMap
          Storage for annotation values
 
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
 
Constructor Summary
TransformAnnotation()
          Creates a new annotation.
 
Method Summary
 ITransformAnnotation.IAnnotationDescriptor getAnnotationDescriptor(java.lang.String key)
          Description for a particular annotation type.
 ITransformAnnotation.IAnnotationDescriptor[] getAnnotationDescriptors()
          All known annotation types.
 ITransformAnnotation getAnnotationRecord(long pos)
          The annotation record at a particular position.
 java.lang.String getAnnotationValue(java.lang.String key)
          The specified annotation value.
 java.lang.String getAnnotationValue(java.lang.String key, long pos)
          The specified annotation value at a particular position.
 java.util.Map getAnnotationValues()
          All annotation values.
 java.util.Map getAnnotationValues(long pos)
          All annotation values at a particular position.
 long getLength()
          The last position with a recorded annotation.
 void setAnnotationDescriptor(java.lang.String key, ITransformAnnotation.IAnnotationDescriptor value)
          Sets description for a particular annotation type.
 void setAnnotationRecord(long pos, ITransformAnnotation value)
          Sets the annotation record at a particular position.
 void setAnnotationValue(java.lang.String key, long pos, java.lang.String value)
          Sets an annotation value at a particular position.
 void setAnnotationValue(java.lang.String key, java.lang.String value)
          Sets an annotation value.
 
Methods inherited from class jigcell.compare.impl.Transferer
addExtension, addFlavor, createCSVTable, createFormattedTable, createHTMLTable, getExceptionRecorder, getExpectedClasses, getExpectedClasses, getExpectedClasses, getFlavors, getFlavors, getPreferredExtensions, getPreferredExtensions, getTransferClass, getTransferData, 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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.awt.datatransfer.Transferable
getTransferData, getTransferDataFlavors, isDataFlavorSupported
 

Field Detail

LONG_ZERO

protected static final java.lang.Long LONG_ZERO
Zero


NULL_KEY

protected static final java.lang.Long NULL_KEY
Hash key for non-positional elements


descriptorMap

protected java.util.Map descriptorMap
Storage for annotation descriptors


recordMap

protected java.util.SortedMap recordMap
Storage for annotation records


valueMap

protected java.util.SortedMap valueMap
Storage for annotation values

Constructor Detail

TransformAnnotation

public TransformAnnotation()
Creates a new annotation.

Method Detail

getAnnotationDescriptor

public ITransformAnnotation.IAnnotationDescriptor getAnnotationDescriptor(java.lang.String key)
Description for a particular annotation type.

Specified by:
getAnnotationDescriptor in interface ITransformAnnotation
Parameters:
key - Annotation type

getAnnotationDescriptors

public ITransformAnnotation.IAnnotationDescriptor[] getAnnotationDescriptors()
All known annotation types.

Specified by:
getAnnotationDescriptors in interface ITransformAnnotation

getAnnotationRecord

public ITransformAnnotation getAnnotationRecord(long pos)
The annotation record at a particular position.

Specified by:
getAnnotationRecord in interface ITransformAnnotation
Parameters:
pos - Element position

getAnnotationValue

public java.lang.String getAnnotationValue(java.lang.String key)
The specified annotation value.

Specified by:
getAnnotationValue in interface ITransformAnnotation
Parameters:
key - Annotation type

getAnnotationValue

public java.lang.String getAnnotationValue(java.lang.String key,
                                           long pos)
The specified annotation value at a particular position.

Specified by:
getAnnotationValue in interface ITransformAnnotation
Parameters:
key - Annotation type
pos - Element position

getAnnotationValues

public java.util.Map getAnnotationValues()
All annotation values.

Specified by:
getAnnotationValues in interface ITransformAnnotation

getAnnotationValues

public java.util.Map getAnnotationValues(long pos)
All annotation values at a particular position.

Specified by:
getAnnotationValues in interface ITransformAnnotation
Parameters:
pos - Element position

getLength

public long getLength()
The last position with a recorded annotation.

Specified by:
getLength in interface ITransformAnnotation

setAnnotationDescriptor

public void setAnnotationDescriptor(java.lang.String key,
                                    ITransformAnnotation.IAnnotationDescriptor value)
Sets description for a particular annotation type.

Specified by:
setAnnotationDescriptor in interface ITransformAnnotation
Parameters:
key - Annotation type
value - Annotation description

setAnnotationRecord

public void setAnnotationRecord(long pos,
                                ITransformAnnotation value)
Sets the annotation record at a particular position.

Specified by:
setAnnotationRecord in interface ITransformAnnotation
Parameters:
pos - Element position
value - Annotation record

setAnnotationValue

public void setAnnotationValue(java.lang.String key,
                               java.lang.String value)
Sets an annotation value.

Specified by:
setAnnotationValue in interface ITransformAnnotation
Parameters:
key - Annotation type
value - Annotation description

setAnnotationValue

public void setAnnotationValue(java.lang.String key,
                               long pos,
                               java.lang.String value)
Sets an annotation value at a particular position.

Specified by:
setAnnotationValue in interface ITransformAnnotation
Parameters:
key - Annotation type
pos - Element position
value - Annotation value