public abstract class StructureData
extends java.lang.Object
for (Iterator iter = sdata.getMembers().iterator(); iter.hasNext(); ) { StructureMembers.Member m = (StructureMembers.Member) iter.next(); Array sdataArray = sdata.getArray(m); ... }General ways to access data in an StructureData are:
Array getArray(Member m)
Array getArray(String memberName)The following will return an object of type Byte, Char, Double, Float, Int, Long, Short, String, or Structure, depending upon the member type:
Object getScalarObject( Member m)A number of convenience routines may be able to avoid extra Object creation, and so are recommended for efficiency. These require that you know the data types of the member data, but they are the most efficent:
getScalarXXX(int recnum, Member m) getJavaArrayXXX(int recnum, Member m)where XXX is Byte, Char, Double, Float, Int, Long, Short, or String. For members that are themselves Structures, the equivilent is:
StructureData getScalarStructure(int recnum, Member m) ArrayStructure getArrayStructure(int recnum, Member m)These will return any compatible type as a double or float, but may have extra overhead when the types dont match:
convertScalarXXX(int recnum, Member m) convertJavaArrayXXX(int recnum, Member m)where XXX is Double or Float
ArrayStructure
Modifier and Type | Field and Description |
---|---|
static StructureData |
EMPTY |
protected StructureMembers |
members |
Modifier | Constructor and Description |
---|---|
protected |
StructureData(StructureMembers members)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
double |
convertScalarDouble(java.lang.String memberName)
Get scalar value as a double, with conversion as needed.
|
abstract double |
convertScalarDouble(StructureMembers.Member m)
Get scalar value as a double, with conversion as needed.
|
float |
convertScalarFloat(java.lang.String memberName)
Get scalar value as a float, with conversion as needed.
|
abstract float |
convertScalarFloat(StructureMembers.Member m)
Get scalar value as a float, with conversion as needed.
|
int |
convertScalarInt(java.lang.String memberName)
Get scalar value as a int, with conversion as needed.
|
abstract int |
convertScalarInt(StructureMembers.Member m)
Get scalar value as a int, with conversion as needed.
|
long |
convertScalarLong(java.lang.String memberName)
Get scalar value as a int, with conversion as needed.
|
abstract long |
convertScalarLong(StructureMembers.Member m)
Get scalar value as a int, with conversion as needed.
|
StructureMembers.Member |
findMember(java.lang.String memberName)
Find a member by its name.
|
Array |
getArray(java.lang.String memberName)
Get member data array of any type as an Array.
|
abstract Array |
getArray(StructureMembers.Member m)
Get member data array of any type as an Array.
|
ArraySequence |
getArraySequence(java.lang.String memberName)
Get ArraySequence for a member of type Sequence.
|
abstract ArraySequence |
getArraySequence(StructureMembers.Member m)
Get ArraySequence for a member of type Sequence.
|
ArrayStructure |
getArrayStructure(java.lang.String memberName)
Get member data of type Structure.
|
abstract ArrayStructure |
getArrayStructure(StructureMembers.Member m)
Get ArrayStructure for a member of type Structure.
|
byte[] |
getJavaArrayByte(java.lang.String memberName)
Get java byte array for a member of type byte.
|
abstract byte[] |
getJavaArrayByte(StructureMembers.Member m)
Get java byte array for a member of type byte.
|
char[] |
getJavaArrayChar(java.lang.String memberName)
Get java char array for a member of type char.
|
abstract char[] |
getJavaArrayChar(StructureMembers.Member m)
Get java char array for a member of type char.
|
double[] |
getJavaArrayDouble(java.lang.String memberName)
Get java double array for a member of type double.
|
abstract double[] |
getJavaArrayDouble(StructureMembers.Member m)
Get java double array for a member of type double.
|
float[] |
getJavaArrayFloat(java.lang.String memberName)
Get java float array for a member of type float.
|
abstract float[] |
getJavaArrayFloat(StructureMembers.Member m)
Get java float array for a member of type float.
|
int[] |
getJavaArrayInt(java.lang.String memberName)
Get java int array for a member of type int.
|
abstract int[] |
getJavaArrayInt(StructureMembers.Member m)
Get java int array for a member of type int.
|
long[] |
getJavaArrayLong(java.lang.String memberName)
Get java long array for a member of type long.
|
abstract long[] |
getJavaArrayLong(StructureMembers.Member m)
Get java long array for a member of type long.
|
short[] |
getJavaArrayShort(java.lang.String memberName)
Get java short array for a member of type short.
|
abstract short[] |
getJavaArrayShort(StructureMembers.Member m)
Get java short array for a member of type short.
|
java.lang.String[] |
getJavaArrayString(java.lang.String memberName)
Get java String array for a member of type String.
|
abstract java.lang.String[] |
getJavaArrayString(StructureMembers.Member m)
Get java array of Strings for a member of type char or String.
|
java.util.List<StructureMembers.Member> |
getMembers() |
java.lang.String |
getName() |
byte |
getScalarByte(java.lang.String memberName)
Get member data of type byte.
|
abstract byte |
getScalarByte(StructureMembers.Member m)
Get member data of type byte.
|
char |
getScalarChar(java.lang.String memberName)
Get member data of type char.
|
abstract char |
getScalarChar(StructureMembers.Member m)
Get member data of type char.
|
double |
getScalarDouble(java.lang.String memberName)
Get member data of type double.
|
abstract double |
getScalarDouble(StructureMembers.Member m)
Get member data of type double.
|
float |
getScalarFloat(java.lang.String memberName)
Get member data of type float.
|
abstract float |
getScalarFloat(StructureMembers.Member m)
Get member data of type float.
|
int |
getScalarInt(java.lang.String memberName)
Get member data of type int.
|
abstract int |
getScalarInt(StructureMembers.Member m)
Get member data of type int.
|
long |
getScalarLong(java.lang.String memberName)
Get member data of type long.
|
abstract long |
getScalarLong(StructureMembers.Member m)
Get member data of type long.
|
java.lang.Object |
getScalarObject(java.lang.String memberName)
Get member data array of any type as an Object, eg, Float, Double, String etc.
|
java.lang.Object |
getScalarObject(StructureMembers.Member m)
Get member data array of any type as an Object, eg, Float, Double, String etc.
|
short |
getScalarShort(java.lang.String memberName)
Get member data of type short.
|
abstract short |
getScalarShort(StructureMembers.Member m)
Get member data of type short.
|
java.lang.String |
getScalarString(java.lang.String memberName)
Get String value, from rank 0 String or rank 1 char member array.
|
abstract java.lang.String |
getScalarString(StructureMembers.Member m)
Get String value, from rank 0 String or rank 1 char member array.
|
StructureData |
getScalarStructure(java.lang.String memberName)
Get member data of type Structure.
|
abstract StructureData |
getScalarStructure(StructureMembers.Member m)
Get member data of type Structure.
|
StructureMembers |
getStructureMembers() |
void |
showInternal(java.util.Formatter f,
Indent indent) |
void |
showInternalMembers(java.util.Formatter f,
Indent indent) |
java.lang.String |
toString() |
public static final StructureData EMPTY
protected StructureMembers members
protected StructureData(StructureMembers members)
members
- StructureData is always contained in a StructureArray.public java.lang.String getName()
public StructureMembers getStructureMembers()
public java.util.List<StructureMembers.Member> getMembers()
public StructureMembers.Member findMember(java.lang.String memberName)
memberName
- find member with this namepublic abstract Array getArray(StructureMembers.Member m)
m
- get data from this StructureMembers.Member.public Array getArray(java.lang.String memberName)
memberName
- name of member Variable.java.lang.IllegalArgumentException
- if name is not legal member name.public java.lang.Object getScalarObject(java.lang.String memberName)
memberName
- name of member Variable.public java.lang.Object getScalarObject(StructureMembers.Member m)
m
- get data from this StructureMembers.Member.public float convertScalarFloat(java.lang.String memberName)
memberName
- name of member Variable. Must be convertible to float.ForbiddenConversionException
- if not convertible to float.public abstract float convertScalarFloat(StructureMembers.Member m)
m
- member Variable.ForbiddenConversionException
- if not convertible to float.public double convertScalarDouble(java.lang.String memberName)
memberName
- name of member Variable. Must be convertible to double.ForbiddenConversionException
- if not convertible to double.public abstract double convertScalarDouble(StructureMembers.Member m)
m
- member Variable.ForbiddenConversionException
- if not convertible to double.public int convertScalarInt(java.lang.String memberName)
memberName
- name of member Variable. Must be convertible to double.ForbiddenConversionException
- if not convertible to int.public abstract int convertScalarInt(StructureMembers.Member m)
m
- member Variable.ForbiddenConversionException
- if not convertible to int.public long convertScalarLong(java.lang.String memberName)
memberName
- name of member Variable. Must be convertible to double.ForbiddenConversionException
- if not convertible to int.public abstract long convertScalarLong(StructureMembers.Member m)
m
- member Variable.ForbiddenConversionException
- if not convertible to int.public double getScalarDouble(java.lang.String memberName)
memberName
- name of member Variable. Must be of type double.java.lang.IllegalArgumentException
- if name is not legal member name.public abstract double getScalarDouble(StructureMembers.Member m)
m
- get data from this StructureMembers.Member. Must be of type double.public double[] getJavaArrayDouble(java.lang.String memberName)
memberName
- name of member Variable. Must be of type double.public abstract double[] getJavaArrayDouble(StructureMembers.Member m)
m
- get data from this StructureMembers.Member. Must be of type double.public float getScalarFloat(java.lang.String memberName)
memberName
- name of member Variable. Must be of type float.java.lang.IllegalArgumentException
- if name is not legal member name.public abstract float getScalarFloat(StructureMembers.Member m)
m
- get data from this StructureMembers.Member. Must be of type float.public float[] getJavaArrayFloat(java.lang.String memberName)
memberName
- name of member Variable. Must be of type float.public abstract float[] getJavaArrayFloat(StructureMembers.Member m)
m
- get data from this StructureMembers.Member. Must be of type float.public byte getScalarByte(java.lang.String memberName)
memberName
- name of member Variable. Must be of type byte.java.lang.IllegalArgumentException
- if name is not legal member name.public abstract byte getScalarByte(StructureMembers.Member m)
m
- get data from this StructureMembers.Member. Must be of type byte.public byte[] getJavaArrayByte(java.lang.String memberName)
memberName
- name of member Variable. Must be of type byte.public abstract byte[] getJavaArrayByte(StructureMembers.Member m)
m
- get data from this StructureMembers.Member. Must be of type byte.public int getScalarInt(java.lang.String memberName)
memberName
- name of member Variable. Must be of type int.java.lang.IllegalArgumentException
- if name is not legal member name.public abstract int getScalarInt(StructureMembers.Member m)
m
- get data from this StructureMembers.Member. Must be of type int.public int[] getJavaArrayInt(java.lang.String memberName)
memberName
- name of member Variable. Must be of type int.public abstract int[] getJavaArrayInt(StructureMembers.Member m)
m
- get data from this StructureMembers.Member. Must be of type int.public short getScalarShort(java.lang.String memberName)
memberName
- name of member Variable. Must be of type short.java.lang.IllegalArgumentException
- if name is not legal member name.public abstract short getScalarShort(StructureMembers.Member m)
m
- get data from this StructureMembers.Member. Must be of type short.public short[] getJavaArrayShort(java.lang.String memberName)
memberName
- name of member Variable. Must be of type short.public abstract short[] getJavaArrayShort(StructureMembers.Member m)
m
- get data from this StructureMembers.Member. Must be of type short.public long getScalarLong(java.lang.String memberName)
memberName
- name of member Variable. Must be of type long.java.lang.IllegalArgumentException
- if name is not legal member name.public abstract long getScalarLong(StructureMembers.Member m)
m
- get data from this StructureMembers.Member. Must be of type long.public long[] getJavaArrayLong(java.lang.String memberName)
memberName
- name of member Variable. Must be of type long.public abstract long[] getJavaArrayLong(StructureMembers.Member m)
m
- get data from this StructureMembers.Member. Must be of type long.public char getScalarChar(java.lang.String memberName)
memberName
- name of member Variable. Must be of type char.java.lang.IllegalArgumentException
- if name is not legal member name.public abstract char getScalarChar(StructureMembers.Member m)
m
- get data from this StructureMembers.Member. Must be of type char.public char[] getJavaArrayChar(java.lang.String memberName)
memberName
- name of member Variable. Must be of type char.public abstract char[] getJavaArrayChar(StructureMembers.Member m)
m
- get data from this StructureMembers.Member. Must be of type char.public java.lang.String getScalarString(java.lang.String memberName)
memberName
- name of member Variable.java.lang.IllegalArgumentException
- if name is not legal member name.public abstract java.lang.String getScalarString(StructureMembers.Member m)
m
- get data from this StructureMembers.Member. Must be of type char or String.public java.lang.String[] getJavaArrayString(java.lang.String memberName)
memberName
- name of member Variable. Must be of type char or String.public abstract java.lang.String[] getJavaArrayString(StructureMembers.Member m)
m
- get data from this StructureMembers.Member. Must be of type char or String.public StructureData getScalarStructure(java.lang.String memberName)
memberName
- name of member Variable.java.lang.IllegalArgumentException
- if name is not legal member name.public abstract StructureData getScalarStructure(StructureMembers.Member m)
m
- get data from this StructureMembers.Member. Must be of type Structure.public ArrayStructure getArrayStructure(java.lang.String memberName)
memberName
- name of member Variable.java.lang.IllegalArgumentException
- if name is not legal member name.public abstract ArrayStructure getArrayStructure(StructureMembers.Member m)
m
- get data from this StructureMembers.Member. Must be of type Structure.public ArraySequence getArraySequence(java.lang.String memberName)
memberName
- name of member Variable. Must be of type Sequence.public abstract ArraySequence getArraySequence(StructureMembers.Member m)
m
- get data from this StructureMembers.Member. Must be of type Sequence.public void showInternal(java.util.Formatter f, Indent indent)
public void showInternalMembers(java.util.Formatter f, Indent indent)
public java.lang.String toString()
toString
in class java.lang.Object