Package ucar.ma2
Class ArraySequence
- java.lang.Object
-
- ucar.ma2.Array
-
- ucar.ma2.ArrayStructure
-
- ucar.ma2.ArraySequence
-
- All Implemented Interfaces:
Iterable<StructureData>
public class ArraySequence extends ArrayStructure
ArraySequence is the way to contain the data for a Sequence, using a StructureDataIterator. A Sequence is a one-dimensional Structure with indeterminate length. The only data access is through getStructureIterator(). So an ArraySequence is really a wrapper around a StructureDataIterator, adapting it to an Array.- Since:
- Feb 27, 2008
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class ucar.ma2.ArrayStructure
ArrayStructure.ArrayStructureIterator
-
-
Field Summary
Fields Modifier and Type Field Description protected StructureDataIterator
iter
-
Fields inherited from class ucar.ma2.ArrayStructure
members, nelems, sdata
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
ArraySequence(StructureMembers sm, int[] shape)
ArraySequence(StructureMembers members, StructureDataIterator iter, int nelems)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Array
extractMemberArray(StructureMembers.Member proxym)
Extract data for one member, over all structures.Class
getElementType()
Get the element class type of this Arraylong
getSizeBytes()
Get the total number of bytes in the array.int
getStructureDataCount()
StructureDataIterator
getStructureDataIterator()
protected StructureData
makeStructureData(ArrayStructure as, int index)
void
showInternal(Formatter f, Indent indent)
String
toString()
-
Methods inherited from class ucar.ma2.ArrayStructure
convertScalarDouble, convertScalarFloat, convertScalarInt, convertScalarLong, copy, copyBytes, copyChars, copyDoubles, copyFloats, copyFrom1DJavaArray, copyInts, copyLongs, copyObjects, copySequences, copyShorts, copyStructures, copyTo1DJavaArray, createView, findMember, getArray, getArrayObject, getArraySequence, getArrayStructure, getBoolean, getBoolean, getByte, getByte, getChar, getChar, getDouble, getDouble, getFloat, getFloat, getInt, getInt, getJavaArrayByte, getJavaArrayChar, getJavaArrayDouble, getJavaArrayFloat, getJavaArrayInt, getJavaArrayLong, getJavaArrayShort, getJavaArrayString, getLong, getLong, getMembers, getObject, getObject, getScalarByte, getScalarChar, getScalarDouble, getScalarFloat, getScalarInt, getScalarLong, getScalarObject, getScalarShort, getScalarString, getScalarStructure, getShort, getShort, getStorage, getStructureData, getStructureData, getStructureMemberNames, getStructureMembers, getStructureSize, iterator, sectionNoReduce, setBoolean, setBoolean, setByte, setByte, setChar, setChar, setDouble, setDouble, setFloat, setFloat, setInt, setInt, setLong, setLong, setMemberArray, setObject, setObject, setShort, setShort, showInternalMembers
-
Methods inherited from class ucar.ma2.Array
arraycopy, copyTo1DJavaArray, copyToNDJavaArray, factory, factory, factory, factory, factoryConstant, factoryCopy, flip, get1DJavaArray, get1DJavaArray, getDataAsByteBuffer, getDataAsByteBuffer, getDataAsByteBuffer, getDataType, getIndex, getIndexIterator, getRangeIterator, getRank, getShape, getSize, hasNext, isConstant, isUnsigned, isVlen, makeArray, makeArray, makeArray, makeArrayRankPlusOne, makeFromJavaArray, makeFromJavaArray, makeObjectArray, makeVlenArray, next, nextBoolean, nextByte, nextChar, nextDouble, nextFloat, nextInt, nextLong, nextShort, permute, reduce, reduce, resetLocalIterator, reshape, reshapeNoCopy, section, section, section, sectionNoReduce, shapeToString, slice, transpose
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Field Detail
-
iter
protected StructureDataIterator iter
-
-
Constructor Detail
-
ArraySequence
protected ArraySequence(StructureMembers sm, int[] shape)
-
ArraySequence
public ArraySequence(StructureMembers members, StructureDataIterator iter, int nelems)
Constructor- Parameters:
members
- the membersiter
- the iteratornelems
- iterator count, may be missing (<0)
-
-
Method Detail
-
getElementType
public Class getElementType()
Description copied from class:Array
Get the element class type of this Array- Overrides:
getElementType
in classArrayStructure
- Returns:
- the class of the element
-
getStructureDataIterator
public StructureDataIterator getStructureDataIterator()
- Overrides:
getStructureDataIterator
in classArrayStructure
-
getStructureDataCount
public int getStructureDataCount()
-
getSizeBytes
public long getSizeBytes()
Description copied from class:Array
Get the total number of bytes in the array.- Overrides:
getSizeBytes
in classArrayStructure
- Returns:
- total number of bytes in the array
-
makeStructureData
protected StructureData makeStructureData(ArrayStructure as, int index)
- Specified by:
makeStructureData
in classArrayStructure
-
extractMemberArray
public Array extractMemberArray(StructureMembers.Member proxym) throws IOException
Description copied from class:ArrayStructure
Extract data for one member, over all structures.- Overrides:
extractMemberArray
in classArrayStructure
- Parameters:
proxym
- get data from this StructureMembers.Member.- Returns:
- Array values.
- Throws:
IOException
- on read error (only happens for Sequences, otherwise data is already read)
-
showInternal
public void showInternal(Formatter f, Indent indent)
- Overrides:
showInternal
in classArrayStructure
-
-