CDMA client API  3.1.0
CDMA core library
org.gumtree.data.interfaces.IDataItem Interface Reference

The IDataItem interface defines a IContainer that carries data. More...

Inheritance diagram for org.gumtree.data.interfaces.IDataItem:
org.gumtree.data.interfaces.IContainer

List of all members.

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< IDimensiongetDimensions (int index)
List< IDimensiongetDimensionList ()
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

Detailed Description

The IDataItem interface defines a IContainer that carries data.

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.

Author:
nxi

Member Function Documentation

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.

Returns:
new IDataItem instance

Implements org.gumtree.data.interfaces.IContainer.

Find an attribute by name, ignoring the case.

Parameters:
nameof the requested attribute
Returns:
the attribute, or null if not found

Find the index of the named Dimension in this DataItem.

Parameters:
nameof the dimension
Returns:
the index of the named Dimension, or -1 if not found.

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.

Parameters:
dimensionwhich dimension to fix
valueat what index value
Returns:
a new IDataItem which is a logical slice of this DataItem.
Exceptions:
InvalidRangeException
Deprecated:
use IDataItem#getSlice(int, int)

Read all the data for this IDataItem and return a memory resident IArray. The IArray has the same element type and shape as the IDataItem.

Returns:
the requested data in a memory-resident IArray.
Exceptions:
IOExceptionI/O exception
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.

Parameters:
originof the section in each dimension
shapeof the section in each dimension
Returns:
the requested data in a memory-resident IArray.
Exceptions:
IOExceptionI/O exception
InvalidRangeExceptioninvalid range

Get the description of the DataItem. Default is to use description attribute value.

Returns:
description string, or null if not found.

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.

Returns:
list of IDimension

Get all dimensions (if several are available return a populated corresponding list) of the data item, that are applied on the axis 'index'.

Parameters:
indexof the dimensions
Returns:
list of requested IDimension

Get the list of Dimension names, space delineated.

Returns:
String object

Get the number of bytes for one element of this IDataItem. For DataItems of primitive type, this is equal to getDataType().getSize(). Data items of String type does not know their size, so what they return is undefined.

Returns:
total number of bytes for one element of the IDataItem

Display name of the IDataItem, plus the dimensions.

Returns:
String object
void org.gumtree.data.interfaces.IDataItem.getNameAndDimensions ( StringBuffer  buf,
boolean  longName,
boolean  length 
)

Fill the given buffer with name plus the dimensions.

Parameters:
bufi/o StringBuffer
longNamedisplay the long name
lengthdisplay the length of each dimension

Get shape as a list of IRange objects.

Returns:
list of IRanges, one for each Dimension.

Get the number of dimensions of the IDataItem.

Returns:
integer value

Create a new IDataItem that is a logical subsection of this IDataItem. No data is read until a read method is called on it.

Parameters:
sectionlist 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.
Returns:
a new IDataItem which is a logical section of this DataItem.
Exceptions:
InvalidRangeExceptioninvalid range

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().

Returns:
array of Ranges, one for each Dimension.

Get the shape: length of the IDataItem in each dimension.

Returns:
int array whose length is the rank of this and values are the dimensions length.

Get the total number of elements in the IDataItem. If this is an unlimited IDataItem, will return the current number of elements.

Returns:
total number of elements in the IDataItem.

If total data is less than SizeToCache in bytes, then cache.

Returns:
integer value

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.

Parameters:
dimwhich dimension to fix
valueat what index value
Returns:
a new IDataItem which is a logical slice of this DataItem.
Exceptions:
InvalidRangeExceptioninvalid range

Get the class of the IDataItem's elements.

Returns:
Class object

Get the unit as a string for the DataItem. Default is to use "units" attribute value

Returns:
unit string, or null if not found.

Does this item have its data read and cached?

Returns:
true or false

Override Object.hashCode() to implement equals.

Returns:
integer value

Invalidate the data cache.

Will this IDataItem be cached when read. Set externally, or calculated based on total size < sizeToCache.

Returns:
true is caching

Is this variable is a member of a Structure?

Returns:
boolean value

Is this variable metadata?.

Returns:
true or false

Whether this is a scalar IDataItem (rank == 0).

Returns:
true or false

Can this variable's size grow by the time?. This is equivalent to saying at least one of its dimensions is unlimited.

Returns:
boolean true if this IDataItem can grow

Is this IDataItem unsigned?. Only meaningful for byte, short, int, long types.

Returns:
true or false

Get the value as a byte for a scalar IDataItem. May also be one-dimensional of length 1.

Returns:
byte object
Exceptions:
IOExceptionif there is an IO Error

Get the value as a double for a scalar IDataItem. May also be one-dimensional of length 1.

Returns:
double value
Exceptions:
IOExceptionif there is an IO Error

Get the value as a float for a scalar IDataItem. May also be one-dimensional of length 1.

Returns:
float value
Exceptions:
IOExceptionif there is an IO Error

Get the value as a int for a scalar IDataItem. May also be one-dimensional of length 1.

Returns:
integer value
Exceptions:
IOExceptionif there is an IO Error

Get the value as a long for a scalar IDataItem. May also be one-dimensional of length 1.

Returns:
long value
Exceptions:
IOExceptionif there is an IO Error

Get the value as a short for a scalar IDataItem. May also be one-dimensional of length 1.

Returns:
short value
Exceptions:
IOExceptionif there is an IO Error

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.

Returns:
String object
Exceptions:
IOExceptionif there is an IO Error

Remove the given IAttribute: uses the attribute hashCode to find it.

Parameters:
aIAttribute object
Returns:
true if was found and removed

Implements org.gumtree.data.interfaces.IContainer.

void org.gumtree.data.interfaces.IDataItem.setCachedData ( IArray  cacheData,
boolean  isMetadata 
) throws InvalidArrayTypeException

Set the data cache.

Parameters:
cacheDataIArray object to cache
isMetadata: synthesized data, set true if must be saved (i.e. data not actually in the file).
Exceptions:
InvalidArrayTypeExceptioninvalid type

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.

Parameters:
cachingset if caching.

Set the data type.

Parameters:
dataTypeClass object

Set the dimension on the specified index.

Parameters:
dimIDimension to add to this data item
indIndex the dimension matches

Set the dimensions using the dimensions names. The dimension is searched for recursively in the parent groups.

Parameters:
dimString: whitespace separated list of dimension names, or '*' for Dimension.UNKNOWN.

Set the element size. Usually elementSize is determined by the dataType, use this only for exceptional cases.

Parameters:
elementSizeinteger value

Set sizeToCache.

Parameters:
sizeToCacheinteger value

Set the units of the IDataItem.

Parameters:
unitsas a String object

String representation of IDataItem and its attributes.

Returns:
String object
String org.gumtree.data.interfaces.IDataItem.writeCDL ( String  indent,
boolean  useFullName,
boolean  strict 
)

String representation of a IDataItem and its attributes.

Parameters:
indentstart each line with this much space
useFullNameuse full name, else use short name
strictstrictly comply with ncgen syntax
Returns:
CDL representation of the IDataItem.
Deprecated:
[SOLEIL][clement][2012-04-18] seems to be a plug-in dependent method

The documentation for this interface was generated from the following file:
 All Classes Namespaces Files Functions Variables