Package ucar.array
Class StructureMembers.Member
- java.lang.Object
-
- ucar.array.StructureMembers.Member
-
- Enclosing class:
- StructureMembers
@Immutable public static final class StructureMembers.Member extends Object
A member of a StructureData.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
ArrayType
getArrayType()
Get the ArrayType.ByteOrder
getByteOrder()
The ByteOrder used when storing in StructureDataStorageBB.String
getDescription()
Get the description, if any.int
getHeapIndex()
Get the heap index in the Members list.String
getName()
Get the StructureMember's name.int
getOffset()
The offset from the start of th STructure, used when storing in StructureDataStorageBB.int[]
getShape()
Get the array shape.int
getStorageSizeBytes()
Get the total size in bytes needed for storing the data in this Member.StructureMembers
getStructureMembers()
Get nested StructureMembers, if this is a Structure or Sequence.int
getStructureSize()
Convenience method for members.getStorageSizeBytes().String
getUnitsString()
Get the units string, if any.int
hashCode()
boolean
isScalar()
Is this a scalar (size == 1).boolean
isVlen()
If its a variable length array.int
length()
Get the total number of elements.StructureMembers.MemberBuilder
toBuilder()
Turn into a mutable Builder.String
toString()
-
-
-
Method Detail
-
toBuilder
public StructureMembers.MemberBuilder toBuilder()
Turn into a mutable Builder. Can use toBuilder().build() to copy.
-
getStructureMembers
@Nullable public StructureMembers getStructureMembers()
Get nested StructureMembers, if this is a Structure or Sequence.
-
getName
public String getName()
Get the StructureMember's name.
-
getUnitsString
@Nullable public String getUnitsString()
Get the units string, if any.
-
getDescription
@Nullable public String getDescription()
Get the description, if any.
-
getArrayType
public ArrayType getArrayType()
Get the ArrayType.
-
getHeapIndex
public int getHeapIndex()
Get the heap index in the Members list.
-
getShape
public int[] getShape()
Get the array shape.
-
length
public int length()
Get the total number of elements.
-
isVlen
public boolean isVlen()
If its a variable length array.
-
getByteOrder
public ByteOrder getByteOrder()
The ByteOrder used when storing in StructureDataStorageBB.
-
getOffset
public int getOffset()
The offset from the start of th STructure, used when storing in StructureDataStorageBB.
-
getStorageSizeBytes
public int getStorageSizeBytes()
Get the total size in bytes needed for storing the data in this Member. A Sequence, String, Opaque, and Vlen are always stored on the heap, so this returns 4 bytes used for the heap index. A Structure may be stored on the heap, depending on StructureMembers.isStructuresOnHeap(). If true, then takes 4 bytes. If false, then this will be the sum of the member's sizes (including nested Structures) times the number of Strutures. If the Member is a nested Structure, then this is the size of one Structure times the number of nested Structures.- Returns:
- total size in bytes
-
getStructureSize
public int getStructureSize()
Convenience method for members.getStorageSizeBytes(). Throws exception if not a Structure.
-
isScalar
public boolean isScalar()
Is this a scalar (size == 1).
-
-