|
CDMA plugin API
3.1.0
CDMA core library
|
The IDataItem interface defines a IContainer that carries data. More...
Public Member Functions | |
| IAttribute | findAttributeIgnoreCase (String name) |
| int | findDimensionIndex (String name) |
| IDataItem | getASlice (int dimension, int value) throws InvalidRangeException |
| IArray | getData () throws IOException |
| IArray | getData (int[] origin, int[] shape) throws IOException, InvalidRangeException |
| String | getDescription () |
| List< IDimension > | getDimensions (int index) |
| List< IDimension > | getDimensionList () |
| String | getDimensionsString () |
| int | getElementSize () |
| String | getNameAndDimensions () |
| void | getNameAndDimensions (StringBuffer buf, boolean longName, boolean length) |
| List< IRange > | getRangeList () |
| int | getRank () |
| IDataItem | getSection (List< IRange > section) throws InvalidRangeException |
| List< IRange > | getSectionRanges () |
| int[] | getShape () |
| long | getSize () |
| int | getSizeToCache () |
| IDataItem | getSlice (int dim, int value) throws InvalidRangeException |
| Class<?> | getType () |
| String | getUnitsString () |
| boolean | hasCachedData () |
| int | hashCode () |
| void | invalidateCache () |
| boolean | isCaching () |
| boolean | isMemberOfStructure () |
| boolean | isMetadata () |
| boolean | isScalar () |
| boolean | isUnlimited () |
| boolean | isUnsigned () |
| byte | readScalarByte () throws IOException |
| double | readScalarDouble () throws IOException |
| float | readScalarFloat () throws IOException |
| int | readScalarInt () throws IOException |
| long | readScalarLong () throws IOException |
| short | readScalarShort () throws IOException |
| String | readScalarString () throws IOException |
| boolean | removeAttribute (IAttribute a) |
| void | setCachedData (IArray cacheData, boolean isMetadata) throws InvalidArrayTypeException |
| void | setCaching (boolean caching) |
| void | setDataType (Class<?> dataType) |
| void | setDimensions (String dimString) |
| void | setDimension (IDimension dim, int ind) throws DimensionNotSupportedException |
| void | setElementSize (int elementSize) |
| void | setSizeToCache (int sizeToCache) |
| void | setUnitsString (String units) |
| String | toStringDebug () |
| String | writeCDL (String indent, boolean useFullName, boolean strict) |
| IDataItem | clone () throws CloneNotSupportedException |
The IDataItem interface defines a IContainer that carries data.
pluginAPI A IDataItem is a logical container for data. It has a DataType, a set of Dimensions that define its array shape, and optionally a set of Attributes.
The data item is a descriptor of the underlying IArray. The former comes with all its metadata and location in data source. It associates the data and all its contextual informations. Handling a data item doesn't mandatory mean that the whole matrix it describes has been loaded.
For performance concerns there is a dissociation between the descriptor and the described data.
| IDataItem org.gumtree.data.interfaces.IDataItem.clone | ( | ) | throws CloneNotSupportedException |
Clone this data item. Return a new IDataItem instance but share the same IArray data storage.
Implements org.gumtree.data.interfaces.IContainer.
Find an attribute by name, ignoring the case.
| name | of the requested attribute |
| int org.gumtree.data.interfaces.IDataItem.findDimensionIndex | ( | String | name | ) |
Find the index of the named Dimension in this DataItem.
| name | of the dimension |
| IDataItem org.gumtree.data.interfaces.IDataItem.getASlice | ( | int | dimension, |
| int | value | ||
| ) | throws InvalidRangeException |
Create a new IDataItem that is a logical slice of this IDataItem, by fixing the specified dimension at the specified index value. This reduces rank by 1. No data is read until a read method is called on it.
| dimension | which dimension to fix |
| value | at what index value |
| InvalidRangeException |
| IArray org.gumtree.data.interfaces.IDataItem.getData | ( | ) | throws IOException |
| IArray org.gumtree.data.interfaces.IDataItem.getData | ( | int[] | origin, |
| int[] | shape | ||
| ) | throws IOException, InvalidRangeException |
Read a section of the data for this IDataItem and return a memory resident IArray. The IArray has the same element type as the DataItem. The size of the IArray will be either smaller or equal to the DataItem.
| origin | of the section in each dimension |
| shape | of the section in each dimension |
| IOException | I/O exception |
| InvalidRangeException | invalid range |
Get the description of the DataItem. Default is to use description attribute value.
Get a list of all dimensions used by this IDataItem. The most slowly varying (leftmost for Java and C programmers) dimension is first, the faster varying is the last one. For scalar item, the list is empty.
| List<IDimension> org.gumtree.data.interfaces.IDataItem.getDimensions | ( | int | index | ) |
Get all dimensions (if several are available return a populated corresponding list) of the data item, that are applied on the axis 'index'.
| index | of the dimensions |
Get the list of Dimension names, space delineated.
Display name of the IDataItem, plus the dimensions.
| void org.gumtree.data.interfaces.IDataItem.getNameAndDimensions | ( | StringBuffer | buf, |
| boolean | longName, | ||
| boolean | length | ||
| ) |
Fill the given buffer with name plus the dimensions.
| buf | i/o StringBuffer |
| longName | display the long name |
| length | display the length of each dimension |
| List<IRange> org.gumtree.data.interfaces.IDataItem.getRangeList | ( | ) |
Get shape as a list of IRange objects.
Get the number of dimensions of the IDataItem.
| IDataItem org.gumtree.data.interfaces.IDataItem.getSection | ( | List< IRange > | section | ) | throws InvalidRangeException |
Create a new IDataItem that is a logical subsection of this IDataItem. No data is read until a read method is called on it.
| section | list of IRange, with size equal to getRank(). Each Range corresponds to a dimension, and specifies the section of data to read in that dimension. A Range object may be null, which means use the entire dimension. |
| InvalidRangeException | invalid range |
| List<IRange> org.gumtree.data.interfaces.IDataItem.getSectionRanges | ( | ) |
Get index subsection as an array of Range objects, relative to the original variable. If this is a section, will reflect the index range relative to the original variable. If its a slice, it will have a rank different from this variable. Otherwise it will correspond to this IDataItem's shape, ie match getRanges().
Get the shape: length of the IDataItem in each dimension.
If total data is less than SizeToCache in bytes, then cache.
| IDataItem org.gumtree.data.interfaces.IDataItem.getSlice | ( | int | dim, |
| int | value | ||
| ) | throws InvalidRangeException |
Create a new IDataItem that is a logical slice of this IDataItem, by fixing the specified dimension at the specified index value. This reduces rank by 1. No data is read until a read method is called on it.
| dim | which dimension to fix |
| value | at what index value |
| InvalidRangeException | invalid range |
| Class<?> org.gumtree.data.interfaces.IDataItem.getType | ( | ) |
Get the class of the IDataItem's elements.
Get the unit as a string for the DataItem. Default is to use "units" attribute value
Does this item have its data read and cached?
Override Object.hashCode() to implement equals.
Invalidate the data cache.
| boolean org.gumtree.data.interfaces.IDataItem.isCaching | ( | ) |
Will this IDataItem be cached when read. Set externally, or calculated based on total size < sizeToCache.
Is this variable is a member of a Structure?
| boolean org.gumtree.data.interfaces.IDataItem.isMetadata | ( | ) |
Is this variable metadata?.
| boolean org.gumtree.data.interfaces.IDataItem.isScalar | ( | ) |
Whether this is a scalar IDataItem (rank == 0).
Can this variable's size grow by the time?. This is equivalent to saying at least one of its dimensions is unlimited.
| boolean org.gumtree.data.interfaces.IDataItem.isUnsigned | ( | ) |
Is this IDataItem unsigned?. Only meaningful for byte, short, int, long types.
| byte org.gumtree.data.interfaces.IDataItem.readScalarByte | ( | ) | throws IOException |
Get the value as a byte for a scalar IDataItem. May also be one-dimensional of length 1.
| IOException | if there is an IO Error |
| double org.gumtree.data.interfaces.IDataItem.readScalarDouble | ( | ) | throws IOException |
Get the value as a double for a scalar IDataItem. May also be one-dimensional of length 1.
| IOException | if there is an IO Error |
| float org.gumtree.data.interfaces.IDataItem.readScalarFloat | ( | ) | throws IOException |
Get the value as a float for a scalar IDataItem. May also be one-dimensional of length 1.
| IOException | if there is an IO Error |
| int org.gumtree.data.interfaces.IDataItem.readScalarInt | ( | ) | throws IOException |
Get the value as a int for a scalar IDataItem. May also be one-dimensional of length 1.
| IOException | if there is an IO Error |
| long org.gumtree.data.interfaces.IDataItem.readScalarLong | ( | ) | throws IOException |
Get the value as a long for a scalar IDataItem. May also be one-dimensional of length 1.
| IOException | if there is an IO Error |
| short org.gumtree.data.interfaces.IDataItem.readScalarShort | ( | ) | throws IOException |
Get the value as a short for a scalar IDataItem. May also be one-dimensional of length 1.
| IOException | if there is an IO Error |
| String org.gumtree.data.interfaces.IDataItem.readScalarString | ( | ) | throws IOException |
Get the value as a String for a scalar IDataItem. May also be one-dimensional of length 1. May also be one-dimensional of type CHAR, which will be turned into a scalar String.
| IOException | if there is an IO Error |
Remove the given IAttribute: uses the attribute hashCode to find it.
| a | IAttribute object |
Implements org.gumtree.data.interfaces.IContainer.
| void org.gumtree.data.interfaces.IDataItem.setCachedData | ( | IArray | cacheData, |
| boolean | isMetadata | ||
| ) | throws InvalidArrayTypeException |
Set the data cache.
| cacheData | IArray object to cache |
| isMetadata | : synthesized data, set true if must be saved (i.e. data not actually in the file). |
| InvalidArrayTypeException | invalid type |
| void org.gumtree.data.interfaces.IDataItem.setCaching | ( | boolean | caching | ) |
Set whether to cache or not. Implies that the entire array will be stored, once read. Normally this is set automatically based on size of data.
| caching | set if caching. |
| void org.gumtree.data.interfaces.IDataItem.setDataType | ( | Class<?> | dataType | ) |
Set the data type.
| dataType | Class object |
| void org.gumtree.data.interfaces.IDataItem.setDimension | ( | IDimension | dim, |
| int | ind | ||
| ) | throws DimensionNotSupportedException |
Set the dimension on the specified index.
| dim | IDimension to add to this data item |
| ind | Index the dimension matches |
| void org.gumtree.data.interfaces.IDataItem.setDimensions | ( | String | dimString | ) |
Set the dimensions using the dimensions names. The dimension is searched for recursively in the parent groups.
| dimString | : whitespace separated list of dimension names, or '*' for Dimension.UNKNOWN. |
| void org.gumtree.data.interfaces.IDataItem.setElementSize | ( | int | elementSize | ) |
Set the element size. Usually elementSize is determined by the dataType, use this only for exceptional cases.
| elementSize | integer value |
| void org.gumtree.data.interfaces.IDataItem.setSizeToCache | ( | int | sizeToCache | ) |
Set sizeToCache.
| sizeToCache | integer value |
| void org.gumtree.data.interfaces.IDataItem.setUnitsString | ( | String | units | ) |
Set the units of the IDataItem.
| units | as a String object |
String representation of IDataItem and its attributes.
| String org.gumtree.data.interfaces.IDataItem.writeCDL | ( | String | indent, |
| boolean | useFullName, | ||
| boolean | strict | ||
| ) |
String representation of a IDataItem and its attributes.
| indent | start each line with this much space |
| useFullName | use full name, else use short name |
| strict | strictly comply with ncgen syntax |