@Test public void testBuilder() { Variable.Builder<?> var = Variable.builder().setName("member").setDataType(DataType.FLOAT); Structure struct = Structure.builder().setName("name").addMemberVariable(var) .addAttribute(new Attribute("att", "value")).build(makeDummyGroup()); assertThat(struct.getDataType()).isEqualTo(DataType.STRUCTURE); assertThat(struct.getShortName()).isEqualTo("name"); assertThat(struct.isScalar()).isTrue(); assertThat(struct.getVariableNames()).hasSize(1); assertThat(struct.getVariableNames().get(0)).isEqualTo("member"); assertThat(struct.getVariables()).hasSize(1); assertThat(struct.getVariables().get(0).getShortName()).isEqualTo("member"); assertThat(struct.getVariables().get(0).getDataType()).isEqualTo(DataType.FLOAT); assertThat(struct.getElementSize()).isEqualTo(4); assertThat(struct.isSubset()).isFalse(); assertThat(struct.getNameAndAttributes()).startsWith("Structure name"); assertThat(struct.toString()) .startsWith(String.format("%nStructure {%n" + " float member;%n" + "} name;%n" + ":att = \"value\";")); }
public static Builder<?> builder() { return new Builder2(); }
Structure extends Variable { public static Builder<?> builder() { return new Builder2(); } }
Structure extends Variable { public static Builder<?> builder() { return new Builder2(); } protected  Structure(Builder<?> builder, Group parentGroup); }
Structure extends Variable { public static Builder<?> builder() { return new Builder2(); } protected  Structure(Builder<?> builder, Group parentGroup); @Nullable Variable findVariable(String shortName); int getNumberOfMemberVariables(); @Override int getElementSize(); ImmutableList<Variable> getVariables(); ImmutableList<String> getVariableNames(); boolean isSubset(); StructureMembers makeStructureMembers(); Structure select(List<String> memberNames); Structure select(String varName); @Deprecated StructureData readStructure(int index); @Deprecated ArrayStructure readStructure(int start, int count); @Deprecated StructureDataIterator getStructureIterator(); @Deprecated StructureDataIterator getStructureIterator(int bufferSize); String getNameAndAttributes(); @Override Builder<?> toBuilder(); static Builder<?> builder(); }
Structure extends Variable { public static Builder<?> builder() { return new Builder2(); } protected  Structure(Builder<?> builder, Group parentGroup); @Nullable Variable findVariable(String shortName); int getNumberOfMemberVariables(); @Override int getElementSize(); ImmutableList<Variable> getVariables(); ImmutableList<String> getVariableNames(); boolean isSubset(); StructureMembers makeStructureMembers(); Structure select(List<String> memberNames); Structure select(String varName); @Deprecated StructureData readStructure(int index); @Deprecated ArrayStructure readStructure(int start, int count); @Deprecated StructureDataIterator getStructureIterator(); @Deprecated StructureDataIterator getStructureIterator(int bufferSize); String getNameAndAttributes(); @Override Builder<?> toBuilder(); static Builder<?> builder();  }