@Test public void testSequence() throws IOException, InvalidRangeException { Sequence.Builder<?> structb = Sequence.builder().setName("seq").addMemberVariable("one", DataType.BYTE, "") .addMemberVariable("two", DataType.STRING, "").addMemberVariable("tres", DataType.FLOAT, ""); StructureData sdata = makeStructureData(1); ArrayStructureW cacheData = new ArrayStructureW(sdata.getStructureMembers(), new int[] {2, 2}); for (int i = 0; i < 4; i++) { cacheData.setStructureData(makeStructureData(i + 1), i); } structb.setSourceData(cacheData); Structure struct = structb.build(makeDummyGroup()); Array data = struct.read(); assertThat(data).isNotNull(); assertThat(data).isInstanceOf(ArrayStructure.class); ArrayStructure as = (ArrayStructure) data; try (StructureDataIterator iter = as.getStructureDataIterator()) { int count = 0; while (iter.hasNext()) { StructureData sd = iter.next(); assertThat(compare(sd, makeStructureData(count + 1))).isTrue(); count++; } assertThat(count).isEqualTo(4); } try (StructureDataIterator iter = struct.getStructureIterator()) { int count = 0; while (iter.hasNext()) { StructureData sd = iter.next(); assertThat(compare(sd, makeStructureData(count + 1))).isTrue(); count++; } assertThat(count).isEqualTo(4); } Array data2 = struct.read(new Section()); Formatter f = new Formatter(); CompareNetcdf2 compare = new CompareNetcdf2(f); boolean ok = compare.compareData("testSequence", data, data2, false); if (!ok) { System.out.printf("%s%n", f); } assertThat(ok).isTrue(); }
protected Sequence(Builder<?> builder, Group parentGroup) { super(builder, parentGroup); }
Sequence extends Structure implements Iterable<ucar.array.StructureData> { protected Sequence(Builder<?> builder, Group parentGroup) { super(builder, parentGroup); } }
Sequence extends Structure implements Iterable<ucar.array.StructureData> { protected Sequence(Builder<?> builder, Group parentGroup) { super(builder, parentGroup); } protected  Sequence(Builder<?> builder, Group parentGroup); }
Sequence extends Structure implements Iterable<ucar.array.StructureData> { protected Sequence(Builder<?> builder, Group parentGroup) { super(builder, parentGroup); } protected  Sequence(Builder<?> builder, Group parentGroup); @Deprecated StructureDataIterator getStructureIterator(int bufferSize); @Override Iterator<ucar.array.StructureData> iterator(); @Override Array read(ucar.ma2.Section section); @Override Array read(int[] origin, int[] shape); @Override Array read(String sectionSpec); @Override Array read(List<Range> ranges); @Override StructureData readStructure(int index); @Override ArrayStructure readStructure(int start, int count); @Override Variable slice(int dim, int value); @Override Variable section(Section subsection); Builder<?> toBuilder(); static Builder<?> builder(); }
Sequence extends Structure implements Iterable<ucar.array.StructureData> { protected Sequence(Builder<?> builder, Group parentGroup) { super(builder, parentGroup); } protected  Sequence(Builder<?> builder, Group parentGroup); @Deprecated StructureDataIterator getStructureIterator(int bufferSize); @Override Iterator<ucar.array.StructureData> iterator(); @Override Array read(ucar.ma2.Section section); @Override Array read(int[] origin, int[] shape); @Override Array read(String sectionSpec); @Override Array read(List<Range> ranges); @Override StructureData readStructure(int index); @Override ArrayStructure readStructure(int start, int count); @Override Variable slice(int dim, int value); @Override Variable section(Section subsection); Builder<?> toBuilder(); static Builder<?> builder();  }