Package ucar.ma2
Class StructureMembers
- java.lang.Object
-
- ucar.ma2.StructureMembers
-
public final class StructureMembers extends Object
A Collection of members contained in a StructureData. TODO make immutable
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
StructureMembers.Builder
A builder for StructureMembersstatic class
StructureMembers.Member
A member of a StructureData.static class
StructureMembers.MemberBuilder
-
Constructor Summary
Constructors Constructor Description StructureMembers(String name)
Deprecated.use BuilderStructureMembers(StructureMembers from)
Deprecated.use toBuilder().build(false) to make a copy with no data
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
addMember(int pos, StructureMembers.Member m)
Deprecated.use BuilderStructureMembers.Member
addMember(String name, String desc, String units, DataType dtype, int[] shape)
Deprecated.use Buildervoid
addMember(StructureMembers.Member m)
Deprecated.use Builderstatic StructureMembers.Builder
builder()
Create an StructureMembers builder.boolean
equals(Object o)
StructureMembers.Member
findMember(String memberName)
Find the member by its name.StructureMembers.Member
getMember(int index)
Get the index-th membercom.google.common.collect.ImmutableList<String>
getMemberNames()
Get the names of the members.com.google.common.collect.ImmutableList<StructureMembers.Member>
getMembers()
Get the list of Member objects.String
getName()
Get the StructureMembers' name.int
getStructureSize()
Get the total size of the Structure in bytes.int
hideMember(StructureMembers.Member m)
Deprecated.use Builderstatic StructureMembers.MemberBuilder
memberBuilder()
void
setStructureSize(int structureSize)
Deprecated.use BuilderStructureMembers.Builder
toBuilder(boolean wantsData)
Turn into a mutable Builder.String
toString()
-
-
-
Constructor Detail
-
StructureMembers
@Deprecated public StructureMembers(String name)
Deprecated.use Builder
-
StructureMembers
@Deprecated public StructureMembers(StructureMembers from)
Deprecated.use toBuilder().build(false) to make a copy with no data
-
-
Method Detail
-
getName
public String getName()
Get the StructureMembers' name.
-
addMember
@Deprecated public void addMember(StructureMembers.Member m)
Deprecated.use BuilderAdd a member.
-
addMember
@Deprecated public void addMember(int pos, StructureMembers.Member m)
Deprecated.use BuilderAdd a member at the given position.
-
addMember
@Deprecated public StructureMembers.Member addMember(String name, String desc, String units, DataType dtype, int[] shape)
Deprecated.use Builder
-
hideMember
@Deprecated public int hideMember(StructureMembers.Member m)
Deprecated.use BuilderRemove the given member- Parameters:
m
- member- Returns:
- position that it used to occupy, or -1 if not found
-
getStructureSize
public int getStructureSize()
Get the total size of the Structure in bytes.- Returns:
- the total size of the Structure in bytes.
-
setStructureSize
@Deprecated public void setStructureSize(int structureSize)
Deprecated.use BuilderSet the total size of the Structure in bytes.
-
getMembers
public com.google.common.collect.ImmutableList<StructureMembers.Member> getMembers()
Get the list of Member objects.
-
getMemberNames
public com.google.common.collect.ImmutableList<String> getMemberNames()
Get the names of the members.
-
getMember
public StructureMembers.Member getMember(int index)
Get the index-th member- Parameters:
index
- of member- Returns:
- Member
-
findMember
@Nullable public StructureMembers.Member findMember(String memberName)
Find the member by its name.
-
memberBuilder
public static StructureMembers.MemberBuilder memberBuilder()
-
toBuilder
public StructureMembers.Builder toBuilder(boolean wantsData)
Turn into a mutable Builder. Can use toBuilder().build(wantsData) to copy.
-
builder
public static StructureMembers.Builder builder()
Create an StructureMembers builder.
-
-