|
||||||||||
| 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.EditableDataElement
jigcell.compare.data.PackedDoubleDataElement
public class PackedDoubleDataElement
An implementation of EditableDataElement that uses an array of doubles to store values. Only real values may be placed in this element. This structure is faster and smaller than a PackedTreeDataElement. Removing values from this element does not decrease the memory used until trimToSize (int) is called. PackedDoubleDataElement does not protect against concurrent edits. This element cannot index past 2^31-1. The maximum number of values this element can contain is approximately 2^29, but is likely to fail before then.
This code is licensed under the DARPA BioCOMP Open Source License. See LICENSE for more details.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class jigcell.compare.data.EditableDataElement |
|---|
EditableDataElement.EditableDataElementDelegate |
| Nested classes/interfaces inherited from interface jigcell.compare.IDataElement |
|---|
IDataElement.Type |
| Field Summary | |
|---|---|
private int |
length
Element length |
protected static java.lang.String |
MESSAGE_CHUNKSIZEERROR
Error message when the chunk size is too small |
protected static java.lang.Double |
NAN
NaN |
private java.lang.Double |
scalar
Placeholder for scalar value |
private int |
size
Element pack size |
protected static int |
SIZE_DEFAULTPACK
Size of default element pack |
private double[] |
values
Element values |
| Fields inherited from class jigcell.compare.data.EditableDataElement |
|---|
DOUBLE_NaN, DOUBLE_NINFINITY, DOUBLE_PINFINITY, MESSAGE_PARSEBLOCKERROR, MESSAGE_PARSEERROR, MESSAGE_PARSEEXTRAERROR, MESSAGE_PARSELITERALERROR, PATTERN_FP, prototypeChild, TOKEN_ALL, TOKEN_BLOCKELEMENT, TOKEN_BLOCKEND, TOKEN_BLOCKSTART, TOKEN_LITERAL |
| 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 | |
|---|---|
PackedDoubleDataElement()
Creates a new data element backed by an array of doubles. |
|
PackedDoubleDataElement(int size)
Creates a new data element with packed storage. |
|
| Method Summary | |
|---|---|
void |
clear()
Deletes all values in this element. |
protected EditableDataElement |
constructNew()
Constructs a new element of the same type as this element. |
static IEditableDataElement |
createElement(java.io.Reader reader)
Generates a PackedDoubleDataElement from streaming input. |
static IEditableDataElement |
createElementSafe(java.io.Reader reader)
Generates a PackedDoubleDataElement from streaming input. |
protected java.lang.Object |
getDirect(long pos)
Gets the value at a position. |
long |
getLength()
The number of elements in this element, or 0 if this element is scalar. |
double[] |
getSlice(double[] slice,
long start,
int length,
long stride)
A dense, homogeneous subset of this element represented as a real list. If slice cannot hold the requested range, a new array is created and returned. Slice may be null. If the given start or length has no valid meaning for this element, the value is null. If the subset is not a dense list of reals or slices are not available, the value is null. Position 0 in the returned slice corresponds to position start in the original element. |
double[] |
getValues()
The underlying array of this element. |
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. The array store of this element is always 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. Locking is unnecessary for this element. |
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. Locking is unnecessary for this element. |
protected void |
putDirect(long pos,
java.lang.Object value)
Sets the value at a position. |
protected void |
removeDirect(long pos)
Removes the value at a position. |
protected void |
setLengthDirect(long length)
Sets the known length of an element. |
void |
setValue(IDataElement value)
Sets the element to a list. |
void |
setValues(double[] values,
int length)
Sets the underlying array of this element. |
void |
trimToSize(int size)
Trims the underlying array to a particular size. |
| Methods inherited from class jigcell.compare.data.EditableDataElement |
|---|
copyValue, createElement, createElement, createElement, createElementSafe, createElementSafe, createScalarElement, createScalarElement, createScalarElement, createScalarElement, forceSlice, forceSlice, forceSlice, forceSlice, getBooleanValue, getChecked, getIntegralValue, getListValue, getLiteralValue, getPrototypeChild, getRealValue, getType, getType, makeList, moveValue, putChecked, setPrototypeChild, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValueInterpreted, setValueInterpreted, swapValues, unsetValue |
| Methods inherited from class jigcell.compare.data.DataElement |
|---|
forceBooleanValue, forceBooleanValue, forceIntegralValue, forceIntegralValue, forceListValue, forceLiteralValue, forceLiteralValue, forceRealValue, forceRealValue, forceSlice, getBooleanValue, getIntegralValue, getLiteralValue, getLongObject, getRealValue, 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, 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 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface jigcell.compare.IDataElement |
|---|
forceBooleanValue, forceBooleanValue, forceIntegralValue, forceIntegralValue, forceListValue, forceLiteralValue, forceLiteralValue, forceRealValue, forceRealValue, forceSlice, getBooleanValue, getIntegralValue, getLiteralValue, getRealValue, getSlice, getSlice, getSlice, getSlice, isScalar, toString, toString, toString, toString, toString, toString, toString |
| Methods inherited from interface java.awt.datatransfer.Transferable |
|---|
getTransferData, getTransferDataFlavors, isDataFlavorSupported |
| Field Detail |
|---|
protected static final java.lang.Double NAN
protected static final int SIZE_DEFAULTPACK
protected static final java.lang.String MESSAGE_CHUNKSIZEERROR
private double[] values
private java.lang.Double scalar
private int length
private int size
| Constructor Detail |
|---|
public PackedDoubleDataElement()
public PackedDoubleDataElement(int size)
size - Pack size| Method Detail |
|---|
public static IEditableDataElement createElement(java.io.Reader reader)
reader - Readerpublic static IEditableDataElement createElementSafe(java.io.Reader reader)
reader - Readerpublic void clear()
public long getLength()
getLength in interface IDataElementgetLength in class DataElement
public double[] getSlice(double[] slice,
long start,
int length,
long stride)
getSlice in interface IDataElementgetSlice in class DataElementslice - Suggested container for the slicestart - First position to pulllength - Number of positions to pullstride - Interval between positions to pullpublic double[] getValues()
public 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 DataElementpublic void setValue(IDataElement value)
setValue in interface IEditableDataElementsetValue in class EditableDataElementvalue - Value
public void setValues(double[] values,
int length)
values - Underlying arraypublic void trimToSize(int size)
size - Sizeprotected EditableDataElement constructNew()
constructNew in class EditableDataElementprotected java.lang.Object getDirect(long pos)
getDirect in class EditableDataElementpos - Position
protected void putDirect(long pos,
java.lang.Object value)
putDirect in class EditableDataElementpos - Positionvalue - Valueprotected void removeDirect(long pos)
removeDirect in class EditableDataElementpos - Positionprotected void setLengthDirect(long length)
setLengthDirect in class EditableDataElementlength - Length of element
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||