jigcell.compare.impl
Class DataManager

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

public final class DataManager
extends Transferer

Maintains and distributes data sources on demand. Potential data transfer agents should register with this class to provide data sources to interested consumers.

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

Author:
Nicholas Allen
See Also:
Serialized Form

Field Summary
private  java.util.Map preferredSources
          Preferred data source for each class
private  java.util.Set readables
          Readable data sources
private  EDU.oswego.cs.dl.util.concurrent.ReadWriteLock SOURCE_LOCK
          Lock for manipulating sources
private  java.util.Set writeables
          Writeable data sources
 
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
DataManager()
          Creates a new repository for data sources.
 
Method Summary
 void addPrototypeSource(IDataSource source)
          Adds the prototype source of a data transfer agent.
private  java.util.List copyPrototypes(java.util.Set set)
          Copies sources from one of the master lists.
 IDataSource getPreferredSource(java.lang.Class clazz)
          The preferred data source of a particular type.
 java.util.List getPrototypeReadables()
          The readable data sources known to this manager.
 java.util.List getPrototypeSources()
          The data sources known to this manager.
 java.util.List getPrototypeWriteables()
          The writeable data sources known to this manager.
 
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
 

Field Detail

preferredSources

private final java.util.Map preferredSources
Preferred data source for each class


SOURCE_LOCK

private final EDU.oswego.cs.dl.util.concurrent.ReadWriteLock SOURCE_LOCK
Lock for manipulating sources


readables

private final java.util.Set readables
Readable data sources


writeables

private final java.util.Set writeables
Writeable data sources

Constructor Detail

DataManager

public DataManager()
Creates a new repository for data sources.

Method Detail

addPrototypeSource

public void addPrototypeSource(IDataSource source)
Adds the prototype source of a data transfer agent.

Parameters:
source - Source

getPreferredSource

public IDataSource getPreferredSource(java.lang.Class clazz)
The preferred data source of a particular type. If there is no data source of that type, null is returned.

Parameters:
clazz - Class or superclass of the desired data source

getPrototypeReadables

public java.util.List getPrototypeReadables()
The readable data sources known to this manager.


getPrototypeSources

public java.util.List getPrototypeSources()
The data sources known to this manager.


getPrototypeWriteables

public java.util.List getPrototypeWriteables()
The writeable data sources known to this manager.


copyPrototypes

private java.util.List copyPrototypes(java.util.Set set)
Copies sources from one of the master lists.

Parameters:
set - Set