public abstract class StructureData extends 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 |
Modifier and Type | Method and Description |
---|---|
double |
convertScalarDouble(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(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(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(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(String memberName)
Find a member by its name.
|
Array |
getArray(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(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(String memberName)
Get member data of type Structure.
|
abstract ArrayStructure |
getArrayStructure(StructureMembers.Member m)
Get ArrayStructure for a member of type Structure.
|
byte[] |
getJavaArrayByte(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(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(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(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(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(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(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.
|
String[] |
getJavaArrayString(String memberName)
Get java String array for a member of type String.
|
abstract String[] |
getJavaArrayString(StructureMembers.Member m)
Get java array of Strings for a member of type char or String.
|
List<StructureMembers.Member> |
getMembers() |
String |
getName() |
byte |
getScalarByte(String memberName)
Get member data of type byte.
|
abstract byte |
getScalarByte(StructureMembers.Member m)
Get member data of type byte.
|
char |
getScalarChar(String memberName)
Get member data of type char.
|
abstract char |
getScalarChar(StructureMembers.Member m)
Get member data of type char.
|
double |
getScalarDouble(String memberName)
Get member data of type double.
|
abstract double |
getScalarDouble(StructureMembers.Member m)
Get member data of type double.
|
float |
getScalarFloat(String memberName)
Get member data of type float.
|
abstract float |
getScalarFloat(StructureMembers.Member m)
Get member data of type float.
|
int |
getScalarInt(String memberName)
Get member data of type int.
|
abstract int |
getScalarInt(StructureMembers.Member m)
Get member data of type int.
|
long |
getScalarLong(String memberName)
Get member data of type long.
|
abstract long |
getScalarLong(StructureMembers.Member m)
Get member data of type long.
|
Object |
getScalarObject(String memberName)
Get member data array of any type as an Object, eg, Float, Double, String etc.
|
Object |
getScalarObject(StructureMembers.Member m)
Get member data array of any type as an Object, eg, Float, Double, String etc.
|
short |
getScalarShort(String memberName)
Get member data of type short.
|
abstract short |
getScalarShort(StructureMembers.Member m)
Get member data of type short.
|
String |
getScalarString(String memberName)
Get String value, from rank 0 String or rank 1 char member array.
|
abstract String |
getScalarString(StructureMembers.Member m)
Get String value, from rank 0 String or rank 1 char member array.
|
StructureData |
getScalarStructure(String memberName)
Get member data of type Structure.
|
abstract StructureData |
getScalarStructure(StructureMembers.Member m)
Get member data of type Structure.
|
StructureMembers |
getStructureMembers() |
void |
showInternal(Formatter f,
Indent indent) |
void |
showInternalMembers(Formatter f,
Indent indent) |
String |
toString() |
public static final StructureData EMPTY
public String getName()
public StructureMembers getStructureMembers()
public List<StructureMembers.Member> getMembers()
public StructureMembers.Member findMember(String memberName)
memberName
- find member with this namepublic abstract Array getArray(StructureMembers.Member m)
m
- get data from this StructureMembers.Member.public Array getArray(String memberName)
memberName
- name of member Variable.IllegalArgumentException
- if name is not legal member name.public Object getScalarObject(String memberName)
memberName
- name of member Variable.public Object getScalarObject(StructureMembers.Member m)
m
- get data from this StructureMembers.Member.public float convertScalarFloat(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(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(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(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(String memberName)
memberName
- name of member Variable. Must be of type double.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(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(String memberName)
memberName
- name of member Variable. Must be of type float.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(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(String memberName)
memberName
- name of member Variable. Must be of type byte.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(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(String memberName)
memberName
- name of member Variable. Must be of type int.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(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(String memberName)
memberName
- name of member Variable. Must be of type short.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(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(String memberName)
memberName
- name of member Variable. Must be of type long.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(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(String memberName)
memberName
- name of member Variable. Must be of type char.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(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 String getScalarString(String memberName)
memberName
- name of member Variable.IllegalArgumentException
- if name is not legal member name.public abstract String getScalarString(StructureMembers.Member m)
m
- get data from this StructureMembers.Member. Must be of type char or String.public String[] getJavaArrayString(String memberName)
memberName
- name of member Variable. Must be of type char or String.public abstract String[] getJavaArrayString(StructureMembers.Member m)
m
- get data from this StructureMembers.Member. Must be of type char or String.public StructureData getScalarStructure(String memberName)
memberName
- name of member Variable.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(String memberName)
memberName
- name of member Variable.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(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.