|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.knime.core.data.DataCell
org.knime.core.data.collection.SparseListCell
public class SparseListCell
Sparse implementation of a CollectionDataValue. The class
stores a default value and a mapping of indices and values unequal to the
default value.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.knime.core.data.collection.CollectionDataValue |
|---|
CollectionDataValue.CollectionUtilityFactory |
| Nested classes/interfaces inherited from interface org.knime.core.data.DataValue |
|---|
DataValue.UtilityFactory |
| Field Summary |
|---|
| Fields inherited from interface org.knime.core.data.collection.CollectionDataValue |
|---|
UTILITY |
| Constructor Summary | |
|---|---|
protected |
SparseListCell(int size,
BlobSupportDataCellList elements,
int[] elementIdxs,
DataCell defaultElement)
Constructor for class SparseListCell. |
| Method Summary | |
|---|---|
boolean |
containsBlobWrapperCells()
Get whether the collection contains special BlobWrapperDataCell
(framework use). |
protected boolean |
equalsDataCell(DataCell dc)
Derived classes implement their specific equals function here. |
DataCell |
get(int index)
Returns the cell at the specified position in the list. |
int[] |
getAllIndices()
Returns a copy of the array that contains all indices of the explicitly set values of this list. |
static DataCellSerializer<SparseListCell> |
getCellSerializer()
Get serializer as required by DataCell. |
static DataType |
getCollectionType(DataType elementType)
Convenience method to determine the type of collection. |
DataCell |
getDefaultElement()
|
DataType |
getElementType()
Get the common super type of all elements in this collection. |
protected int |
getIdx(int idx)
|
protected int |
getIdxLength()
|
protected int[] |
getIdxs()
|
protected BlobSupportDataCellList |
getValueList()
|
int |
hashCode()
This method must be implemented in order to ensure that two equal DataCell objects return the same hash code. |
Iterator<DataCell> |
iterator()
|
int |
size()
Get the number of elements in this collection. |
String |
toString()
Returns the String representation of this cell's value. |
| Methods inherited from class org.knime.core.data.DataCell |
|---|
equals, getType, isMissing |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
protected SparseListCell(int size,
BlobSupportDataCellList elements,
int[] elementIdxs,
DataCell defaultElement)
size - the size of the vector.
Indices must be smaller than this number.elements - the elements unequal to the default elementelementIdxs - the array containing the indices of the elements to
store. MUST be sorted (lowest index first).defaultElement - the element that should be returned as default
value if no value is set
IllegalArgumentException - if length is negative or if the array
contains negative indices or indices larger than length - or
if the array is not sorted or the arrays do not have the same
length or the default element is null!| Method Detail |
|---|
public static DataType getCollectionType(DataType elementType)
DataType.getType(ListCell.class, elementType).
elementType - The type of the elements
public static DataCellSerializer<SparseListCell> getCellSerializer()
DataCell.
public DataType getElementType()
getElementType in interface CollectionDataValueprotected int getIdx(int idx)
idx - the index in the index array to get the stored index for
protected int getIdxLength()
protected BlobSupportDataCellList getValueList()
protected int[] getIdxs()
public DataCell get(int index)
get in interface ListDataValueindex - the position of the element to return (first element has
index zero).
public DataCell getDefaultElement()
getDefaultElement in interface SparseListDataValuepublic Iterator<DataCell> iterator()
iterator in interface Iterable<DataCell>iterator in interface CollectionDataValuepublic int size()
size in interface CollectionDataValuepublic boolean containsBlobWrapperCells()
BlobWrapperDataCell
(framework use). This method gives a hint to the framwork (specifically
to the classes DataContainer and BufferedDataContainer) whether they should handle the cell implementing
this interface with care with respect to contained BlobDataCell.
This method should return true only if
CollectionDataValue.iterator() implements
BlobSupportDataCellIterator (which allows the framework to access
the BlobWrapperDataCell without touching the contained
BlobDataCell (which is an expensive operation) and BlobWrapperDataCell.Implementation note: This method is really only a helper for the framework. The same information can be retrieved by accessing the iterator. This can be an expensive and unnecessary operation, however.
containsBlobWrapperCells in interface CollectionDataValuepublic int[] getAllIndices()
getAllIndices in interface SparseListDataValueprotected boolean equalsDataCell(DataCell dc)
null or a missing value,
to be of the same class like this.
equalsDataCell in class DataCelldc - the cell to compare this to
true if this is equal to the argument,
false if notpublic int hashCode()
DataCell objects return the same hash code.
hashCode in class DataCellDataCellObject.hashCode(),
DataCell.equals(java.lang.Object)public String toString()
toString in class DataCell
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||