|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.swing.TransferHandler
jigcell.compare.impl.Transferer
jigcell.compare.data.DataElement
jigcell.compare.data.CachedDataElement
public class CachedDataElement
A data element that provides a memory sensitive cache wrapped around another data element.
This code is licensed under the DARPA BioCOMP Open Source License. See LICENSE for more details.
| Nested Class Summary | |
|---|---|
protected static class |
CachedDataElement.CachedDataElementDelegate
Persists the element by creating a new wrapper around the cached element. |
| Nested classes/interfaces inherited from interface jigcell.compare.IDataElement |
|---|
IDataElement.Type |
| Field Summary | |
|---|---|
protected IDataElement |
cache
Element for use in memory locking |
protected ExceptionRecorder |
exception
Cached exception recorder for this transferer |
protected java.io.File |
file
File where the data element can be found |
protected java.lang.ref.SoftReference |
ref
Data element to cache |
protected static java.lang.String |
TEMPFILE_PREFIX
Prefix for temporary cache files |
| Fields inherited from class jigcell.compare.data.DataElement |
|---|
lockCount, LONGPOOL, PATTERN_FALSE, PATTERN_NAN, PATTERN_NINFINITY, PATTERN_NINFINITY2, PATTERN_NULL, PATTERN_PINFINITY, PATTERN_PINFINITY2, PATTERN_TRUE, PATTERN_VOID, SIZE_LONGPOOL |
| 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 | |
|---|---|
private |
CachedDataElement()
Creates a new data element cache. |
|
CachedDataElement(IDataElement element)
Creates a new data element cache. |
| Method Summary | |
|---|---|
protected void |
createCachedElement(IDataElement element)
Creates the backend representation of the cached element. |
boolean |
getBooleanValue(long pos)
The element at position pos represented as a boolean. If the given position has no valid meaning for this element, the value is false. |
protected IDataElement |
getCachedElement()
Retrieves the cached element for use. |
protected ExceptionRecorder |
getExceptionRecorder()
The exception recorder this transferer should use. |
long |
getIntegralValue(long pos)
The element at position pos represented as an integer. If the given position has no valid meaning for this element, the value is 0. |
long |
getLength()
The number of elements in this element, or 0 if this element is scalar. |
IDataElement |
getListValue(long pos)
This element at position pos represented as a list. If the given position has no valid meaning for this element, the value is null. |
java.lang.String |
getLiteralValue(long pos)
The element at position pos represented as a string literal. If the given position has no valid meaning for this element, the value is null. The literal is not quoted. |
double |
getRealValue(long pos)
The element at position pos represented as a real. If the given position has no valid meaning for this element, the value is NaN. |
IDataElement.Type |
getType()
The type of this element. |
IDataElement.Type |
getType(long pos)
The type of the element at position pos. If the given position has no valid meaning for this object, the type is TYPE_NONE. |
boolean |
isAvailable()
Whether the element data can currently be worked with. Editing the internal state of a data generator while locked may cause subsequent calls to isAvailable to incorrectly report that the element data is available. |
void |
memoryLock()
Forces the element to guarantee that the element data can currently be worked with. Implementations may or may not support reentrancy or other forms of multiple locking. Editing the internal state of a data generator while locked may cause subsequent calls to memoryLock to incorrectly terminate without guarantee that the element data can currently be worked with. |
void |
memoryUnlock()
Releases the element from the guarantee that the element data can currently be worked with. Implementations may or may not support reentrancy or other forms of multiple locking. |
private void |
readObject(java.io.ObjectInputStream objectIn)
|
private void |
writeObject(java.io.ObjectOutputStream objectOut)
|
| Methods inherited from class jigcell.compare.data.DataElement |
|---|
forceBooleanValue, forceBooleanValue, forceIntegralValue, forceIntegralValue, forceListValue, forceLiteralValue, forceLiteralValue, forceRealValue, forceRealValue, forceSlice, forceSlice, forceSlice, forceSlice, forceSlice, getBooleanValue, getIntegralValue, getLiteralValue, getLongObject, getRealValue, getSlice, getSlice, getSlice, getSlice, getSlice, getTransferData, isScalar, isSpecialNonNumeric, toString, toString, toString, toString, toString, toString, toString, toString, toString, toString, toString, toString, toString, toString, toString, toString |
| Methods inherited from class jigcell.compare.impl.Transferer |
|---|
addExtension, addFlavor, createCSVTable, createFormattedTable, createHTMLTable, 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 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.awt.datatransfer.Transferable |
|---|
getTransferDataFlavors, isDataFlavorSupported |
| Field Detail |
|---|
protected static final java.lang.String TEMPFILE_PREFIX
protected transient ExceptionRecorder exception
protected transient java.io.File file
protected transient IDataElement cache
protected transient java.lang.ref.SoftReference ref
| Constructor Detail |
|---|
public CachedDataElement(IDataElement element)
throws java.io.IOException
element - Element to cache
java.io.IOExceptionprivate CachedDataElement()
| Method Detail |
|---|
public boolean getBooleanValue(long pos)
getBooleanValue in interface IDataElementgetBooleanValue in class DataElementpos - Positionpublic long getIntegralValue(long pos)
getIntegralValue in interface IDataElementgetIntegralValue in class DataElementpos - Positionpublic long getLength()
getLength in interface IDataElementgetLength in class DataElementpublic IDataElement getListValue(long pos)
getListValue in interface IDataElementgetListValue in class DataElementpos - Positionpublic java.lang.String getLiteralValue(long pos)
getLiteralValue in interface IDataElementgetLiteralValue in class DataElementpos - Positionpublic double getRealValue(long pos)
getRealValue in interface IDataElementgetRealValue in class DataElementpos - Positionpublic IDataElement.Type getType()
getType in interface IDataElementgetType in class DataElementpublic IDataElement.Type getType(long pos)
getType in interface IDataElementgetType in class DataElementpos - Positionpublic boolean isAvailable()
isAvailable in interface IDataElementisAvailable in class DataElementpublic void memoryLock()
memoryLock in interface IDataElementmemoryLock in class DataElementpublic void memoryUnlock()
memoryUnlock in interface IDataElementmemoryUnlock in class DataElement
protected void createCachedElement(IDataElement element)
throws java.io.IOException
java.io.IOExceptionprotected IDataElement getCachedElement()
protected ExceptionRecorder getExceptionRecorder()
getExceptionRecorder in class Transferer
private void readObject(java.io.ObjectInputStream objectIn)
throws java.io.IOException,
java.lang.ClassNotFoundException
java.io.IOException
java.lang.ClassNotFoundException
private void writeObject(java.io.ObjectOutputStream objectOut)
throws java.io.IOException
java.io.IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||