public class ArraySequenceNested extends ArrayStructure
ArraySequence aseq = new ArraySequence( members, outerLength); for (int seq=0; seq < outerLength; seq++) { aseq.setSequenceLength(seq, seqLength); } aseq.finish();
ArrayStructure.ArrayStructureIterator
members, nelems, sdata
Constructor and Description |
---|
ArraySequenceNested(StructureMembers members,
int nseq)
This is used for inner sequences, ie variable length structures nested inside of another structure.
|
Modifier and Type | Method and Description |
---|---|
void |
finish()
Call this when you have set all the sequence lengths.
|
ArrayStructure |
flatten()
Flatten the Structures into a 1D array of Structures of length getTotalNumberOfStructures().
|
ArrayStructure |
getArrayStructure(int recnum,
StructureMembers.Member m)
Get member data of type array of Structure.
|
byte[] |
getJavaArrayByte(int recnum,
StructureMembers.Member m)
Get member data of type byte as a 1D array.
|
char[] |
getJavaArrayChar(int recnum,
StructureMembers.Member m)
Get member data of type char as a 1D array.
|
double[] |
getJavaArrayDouble(int recnum,
StructureMembers.Member m)
Get member data of type double as a 1D array.
|
float[] |
getJavaArrayFloat(int recnum,
StructureMembers.Member m)
Get member data of type float as a 1D array.
|
int[] |
getJavaArrayInt(int recnum,
StructureMembers.Member m)
Get member data of type int as a 1D array.
|
long[] |
getJavaArrayLong(int recnum,
StructureMembers.Member m)
Get member data of type long as a 1D array.
|
short[] |
getJavaArrayShort(int recnum,
StructureMembers.Member m)
Get member data of type short as a 1D array.
|
java.lang.String[] |
getJavaArrayString(int recnum,
StructureMembers.Member m)
Get member data of type String as a 1D array.
|
byte |
getScalarByte(int recnum,
StructureMembers.Member m)
Get scalar member data of type byte.
|
char |
getScalarChar(int recnum,
StructureMembers.Member m)
Get scalar member data of type char.
|
double |
getScalarDouble(int recnum,
StructureMembers.Member m)
Get scalar member data of type double.
|
float |
getScalarFloat(int recnum,
StructureMembers.Member m)
Get scalar member data of type float.
|
int |
getScalarInt(int recnum,
StructureMembers.Member m)
Get scalar member data of type int.
|
long |
getScalarLong(int recnum,
StructureMembers.Member m)
Get scalar member data of type long.
|
short |
getScalarShort(int recnum,
StructureMembers.Member m)
Get scalar member data of type short.
|
java.lang.String |
getScalarString(int recnum,
StructureMembers.Member m)
Get member data of type String or char.
|
StructureData |
getScalarStructure(int recnum,
StructureMembers.Member m)
Get member data of type Structure.
|
int |
getSequenceLength(int outerIndex)
Get the length of the ith sequence.
|
int |
getSequenceOffset(int outerIndex)
Get the the starting index of the ith sequence.
|
StructureData |
getStructureData(int index)
Get the index-th StructureData of this ArrayStructure.
|
int |
getTotalNumberOfStructures() |
protected StructureData |
makeStructureData(ArrayStructure as,
int index) |
void |
setSequenceLength(int outerIndex,
int len)
Set the length of one of the sequences.
|
convertScalarDouble, convertScalarFloat, convertScalarInt, convertScalarLong, copy, copyBytes, copyChars, copyDoubles, copyFloats, copyFrom1DJavaArray, copyInts, copyLongs, copyObjects, copySequences, copyShorts, copyStructures, copyTo1DJavaArray, createView, extractMemberArray, findMember, getArray, getArrayObject, getArraySequence, getBoolean, getBoolean, getByte, getByte, getChar, getChar, getDouble, getDouble, getElementType, getFloat, getFloat, getInt, getInt, getLong, getLong, getMembers, getObject, getObject, getScalarObject, getShort, getShort, getSizeBytes, getStorage, getStructureData, getStructureDataIterator, getStructureMemberNames, getStructureMembers, getStructureSize, sectionNoReduce, setBoolean, setBoolean, setByte, setByte, setChar, setChar, setDouble, setDouble, setFloat, setFloat, setInt, setInt, setLong, setLong, setMemberArray, setObject, setObject, setShort, setShort, showInternal, showInternalMembers
arraycopy, copyTo1DJavaArray, copyToNDJavaArray, factory, factory, factory, factory, factory, factory, factoryConstant, flip, get1DJavaArray, getDataAsByteBuffer, getDataAsByteBuffer, getDataAsByteBuffer, getDataType, getIndex, getIndexIterator, getIndexIteratorFast, getIndexPrivate, getRangeIterator, getRank, getShape, getSize, hasNext, isConstant, isUnsigned, makeArray, makeArray, makeArray, makeArray, makeArrayRankPlusOne, next, nextBoolean, nextByte, nextChar, nextDouble, nextFloat, nextInt, nextLong, nextShort, permute, reduce, reduce, resetLocalIterator, reshape, reshapeNoCopy, section, section, section, sectionNoReduce, setUnsigned, shapeToString, slice, toString, transpose
public ArraySequenceNested(StructureMembers members, int nseq)
members
- the members of the STructurenseq
- the number of sequences, ie the length of the outer structure.protected StructureData makeStructureData(ArrayStructure as, int index)
makeStructureData
in class ArrayStructure
public StructureData getStructureData(int index)
ArrayStructure
getStructureData
in class ArrayStructure
index
- which one to get, specified by an integer.public void setSequenceLength(int outerIndex, int len)
outerIndex
- which sequence?len
- what is its length?public int getSequenceLength(int outerIndex)
outerIndex
- which sequence?public int getSequenceOffset(int outerIndex)
outerIndex
- which sequence?public void finish()
public int getTotalNumberOfStructures()
public ArrayStructure flatten()
public double getScalarDouble(int recnum, StructureMembers.Member m)
ArrayStructure
getScalarDouble
in class ArrayStructure
recnum
- get data from the recnum-th StructureData of the ArrayStructure. Must be less than getSize();m
- get data from this StructureMembers.Member. Must be of type double.public double[] getJavaArrayDouble(int recnum, StructureMembers.Member m)
ArrayStructure
getJavaArrayDouble
in class ArrayStructure
recnum
- get data from the recnum-th StructureData of the ArrayStructure. Must be less than getSize();m
- get data from this StructureMembers.Member. Must be of type double.public float getScalarFloat(int recnum, StructureMembers.Member m)
ArrayStructure
getScalarFloat
in class ArrayStructure
recnum
- get data from the recnum-th StructureData of the ArrayStructure. Must be less than getSize();m
- get data from this StructureMembers.Member. Must be of type float.public float[] getJavaArrayFloat(int recnum, StructureMembers.Member m)
ArrayStructure
getJavaArrayFloat
in class ArrayStructure
recnum
- get data from the recnum-th StructureData of the ArrayStructure. Must be less than getSize();m
- get data from this StructureMembers.Member. Must be of type float.public byte getScalarByte(int recnum, StructureMembers.Member m)
ArrayStructure
getScalarByte
in class ArrayStructure
recnum
- get data from the recnum-th StructureData of the ArrayStructure. Must be less than getSize();m
- get data from this StructureMembers.Member. Must be of type byte.public byte[] getJavaArrayByte(int recnum, StructureMembers.Member m)
ArrayStructure
getJavaArrayByte
in class ArrayStructure
recnum
- get data from the recnum-th StructureData of the ArrayStructure. Must be less than getSize();m
- get data from this StructureMembers.Member. Must be of type byte.public short getScalarShort(int recnum, StructureMembers.Member m)
ArrayStructure
getScalarShort
in class ArrayStructure
recnum
- get data from the recnum-th StructureData of the ArrayStructure. Must be less than getSize();m
- get data from this StructureMembers.Member. Must be of type short.public short[] getJavaArrayShort(int recnum, StructureMembers.Member m)
ArrayStructure
getJavaArrayShort
in class ArrayStructure
recnum
- get data from the recnum-th StructureData of the ArrayStructure. Must be less than getSize();m
- get data from this StructureMembers.Member. Must be of type float.public int getScalarInt(int recnum, StructureMembers.Member m)
ArrayStructure
getScalarInt
in class ArrayStructure
recnum
- get data from the recnum-th StructureData of the ArrayStructure. Must be less than getSize();m
- get data from this StructureMembers.Member. Must be of type int.public int[] getJavaArrayInt(int recnum, StructureMembers.Member m)
ArrayStructure
getJavaArrayInt
in class ArrayStructure
recnum
- get data from the recnum-th StructureData of the ArrayStructure. Must be less than getSize();m
- get data from this StructureMembers.Member. Must be of type int.public long getScalarLong(int recnum, StructureMembers.Member m)
ArrayStructure
getScalarLong
in class ArrayStructure
recnum
- get data from the recnum-th StructureData of the ArrayStructure. Must be less than getSize();m
- get data from this StructureMembers.Member. Must be of type long.public long[] getJavaArrayLong(int recnum, StructureMembers.Member m)
ArrayStructure
getJavaArrayLong
in class ArrayStructure
recnum
- get data from the recnum-th StructureData of the ArrayStructure. Must be less than getSize();m
- get data from this StructureMembers.Member. Must be of type long.public char getScalarChar(int recnum, StructureMembers.Member m)
ArrayStructure
getScalarChar
in class ArrayStructure
recnum
- get data from the recnum-th StructureData of the ArrayStructure. Must be less than getSize();m
- get data from this StructureMembers.Member. Must be of type char.public char[] getJavaArrayChar(int recnum, StructureMembers.Member m)
ArrayStructure
getJavaArrayChar
in class ArrayStructure
recnum
- get data from the recnum-th StructureData of the ArrayStructure. Must be less than getSize();m
- get data from this StructureMembers.Member. Must be of type char.public java.lang.String getScalarString(int recnum, StructureMembers.Member m)
ArrayStructure
getScalarString
in class ArrayStructure
recnum
- get data from the recnum-th StructureData of the ArrayStructure. Must be less than getSize();m
- get data from this StructureMembers.Member. Must be of type String or char.public java.lang.String[] getJavaArrayString(int recnum, StructureMembers.Member m)
ArrayStructure
getJavaArrayString
in class ArrayStructure
recnum
- get data from the recnum-th StructureData of the ArrayStructure. Must be less than getSize();m
- get data from this StructureMembers.Member. Must be of type String.public StructureData getScalarStructure(int recnum, StructureMembers.Member m)
ArrayStructure
getScalarStructure
in class ArrayStructure
recnum
- get data from the recnum-th StructureData of the ArrayStructure. Must be less than getSize();m
- get data from this StructureMembers.Member. Must be of type Structure.public ArrayStructure getArrayStructure(int recnum, StructureMembers.Member m)
ArrayStructure
getArrayStructure
in class ArrayStructure
recnum
- get data from the recnum-th StructureData of the ArrayStructure. Must be less than getSize();m
- get data from this StructureMembers.Member. Must be of type Structure.