Package ucar.ma2

Class StructureDataW

  • Direct Known Subclasses:
    StructureDataFromMember, StructureDataScalar

    public class StructureDataW
    extends StructureData
    A StructureData implementation that has its data self-contained. This is often the easiest to construct, but not very efficient for large arrays of Structures. You should call setMemberData() for each member.
    • Constructor Detail

      • StructureDataW

        public StructureDataW​(StructureMembers members)
        Constructor.
        Parameters:
        members - StructureData is always contained in a StructureArray.
      • StructureDataW

        @Deprecated
        public StructureDataW​(StructureMembers members,
                              int size)
        Deprecated.
        use StructureDataW(StructureMembers members)
    • Method Detail

      • setMemberData

        public void setMemberData​(String memberName,
                                  Array data)
      • convertScalarFloat

        public float convertScalarFloat​(StructureMembers.Member m)
        Description copied from class: StructureData
        Get scalar value as a float, with conversion as needed. Underlying type must be convertible to float.
        Specified by:
        convertScalarFloat in class StructureData
        Parameters:
        m - member Variable.
        Returns:
        scalar value as a float
      • convertScalarDouble

        public double convertScalarDouble​(StructureMembers.Member m)
        Description copied from class: StructureData
        Get scalar value as a double, with conversion as needed. Underlying type must be convertible to double.
        Specified by:
        convertScalarDouble in class StructureData
        Parameters:
        m - member Variable.
        Returns:
        scalar value as a double
      • convertScalarInt

        public int convertScalarInt​(StructureMembers.Member m)
        Description copied from class: StructureData
        Get scalar value as a int, with conversion as needed. Underlying type must be convertible to int.
        Specified by:
        convertScalarInt in class StructureData
        Parameters:
        m - member Variable.
        Returns:
        scalar value as a int
      • convertScalarLong

        public long convertScalarLong​(StructureMembers.Member m)
        Description copied from class: StructureData
        Get scalar value as a int, with conversion as needed. Underlying type must be convertible to int.
        Specified by:
        convertScalarLong in class StructureData
        Parameters:
        m - member Variable.
        Returns:
        scalar value as a int
      • getScalarDouble

        public double getScalarDouble​(StructureMembers.Member m)
        Get member data of type double.
        Specified by:
        getScalarDouble in class StructureData
        Parameters:
        m - get data from this StructureMembers.Member. Must be of type double.
        Returns:
        scalar double value
      • getJavaArrayDouble

        public double[] getJavaArrayDouble​(StructureMembers.Member m)
        Get java double array for a member of type double.
        Specified by:
        getJavaArrayDouble in class StructureData
        Parameters:
        m - get data from this StructureMembers.Member. Must be of type double.
        Returns:
        1D java array of doubles
      • getScalarFloat

        public float getScalarFloat​(StructureMembers.Member m)
        Get member data of type float.
        Specified by:
        getScalarFloat in class StructureData
        Parameters:
        m - get data from this StructureMembers.Member. Must be of type float.
        Returns:
        scalar double value
      • getJavaArrayFloat

        public float[] getJavaArrayFloat​(StructureMembers.Member m)
        Get java float array for a member of type float.
        Specified by:
        getJavaArrayFloat in class StructureData
        Parameters:
        m - get data from this StructureMembers.Member. Must be of type float.
        Returns:
        1D java array of floats
      • getScalarByte

        public byte getScalarByte​(StructureMembers.Member m)
        Get member data of type byte.
        Specified by:
        getScalarByte in class StructureData
        Parameters:
        m - get data from this StructureMembers.Member. Must be of type byte.
        Returns:
        scalar byte value
      • getJavaArrayByte

        public byte[] getJavaArrayByte​(StructureMembers.Member m)
        Get java byte array for a member of type byte.
        Specified by:
        getJavaArrayByte in class StructureData
        Parameters:
        m - get data from this StructureMembers.Member. Must be of type byte.
        Returns:
        1D java array of bytes
      • getScalarInt

        public int getScalarInt​(StructureMembers.Member m)
        Get member data of type int.
        Specified by:
        getScalarInt in class StructureData
        Parameters:
        m - get data from this StructureMembers.Member. Must be of type int.
        Returns:
        scalar int value
      • getJavaArrayInt

        public int[] getJavaArrayInt​(StructureMembers.Member m)
        Get java int array for a member of type int.
        Specified by:
        getJavaArrayInt in class StructureData
        Parameters:
        m - get data from this StructureMembers.Member. Must be of type int.
        Returns:
        1D java array of ints
      • getScalarShort

        public short getScalarShort​(StructureMembers.Member m)
        Get member data of type short.
        Specified by:
        getScalarShort in class StructureData
        Parameters:
        m - get data from this StructureMembers.Member. Must be of type short.
        Returns:
        scalar short value
      • getJavaArrayShort

        public short[] getJavaArrayShort​(StructureMembers.Member m)
        Get java short array for a member of type short.
        Specified by:
        getJavaArrayShort in class StructureData
        Parameters:
        m - get data from this StructureMembers.Member. Must be of type short.
        Returns:
        1D java array of shorts
      • getScalarLong

        public long getScalarLong​(StructureMembers.Member m)
        Get member data of type long.
        Specified by:
        getScalarLong in class StructureData
        Parameters:
        m - get data from this StructureMembers.Member. Must be of type long.
        Returns:
        scalar long value
      • getJavaArrayLong

        public long[] getJavaArrayLong​(StructureMembers.Member m)
        Get java long array for a member of type long.
        Specified by:
        getJavaArrayLong in class StructureData
        Parameters:
        m - get data from this StructureMembers.Member. Must be of type long.
        Returns:
        1D java array of longs
      • getScalarChar

        public char getScalarChar​(StructureMembers.Member m)
        Get member data of type char.
        Specified by:
        getScalarChar in class StructureData
        Parameters:
        m - get data from this StructureMembers.Member. Must be of type char.
        Returns:
        scalar char value
      • getJavaArrayChar

        public char[] getJavaArrayChar​(StructureMembers.Member m)
        Get java char array for a member of type char.
        Specified by:
        getJavaArrayChar in class StructureData
        Parameters:
        m - get data from this StructureMembers.Member. Must be of type char.
        Returns:
        1D java array of chars
      • getScalarString

        public String getScalarString​(StructureMembers.Member m)
        Get String value, from rank 0 String or rank 1 char member array.
        Specified by:
        getScalarString in class StructureData
        Parameters:
        m - get data from this StructureMembers.Member. Must be of type char or String.
        Returns:
        scalar String value
      • getJavaArrayString

        public String[] getJavaArrayString​(StructureMembers.Member m)
        Description copied from class: StructureData
        Get java array of Strings for a member of type char or String.
        Specified by:
        getJavaArrayString in class StructureData
        Parameters:
        m - get data from this StructureMembers.Member. Must be of type char or String.
        Returns:
        1D java array of String