private void processSequence(Structure s, StructureDataIterator sdataIter, Counter counter) throws IOException {
    indent.incr();
    int count = 0;
    try {
      while (sdataIter.hasNext()) {
        if (showData) out.format("%sSequence %s count=%d%n", indent, s.getShortName(), count++);
        StructureData sdata = sdataIter.next();
        indent.incr();

        for (StructureMembers.Member m : sdata.getMembers()) {
          Variable v = s.findVariable(m.getName());

          if (m.getDataType().isString() || m.getDataType().isNumeric()) {
            processVariable(v, sdata.getArray(m), counter);

          } else if (m.getDataType() == DataType.STRUCTURE) {
            Structure sds = (Structure) v;
            ArrayStructure data = (ArrayStructure) sdata.getArray(m);
            processSequence(sds, data.getStructureDataIterator(), counter);

          } else if (m.getDataType() == DataType.SEQUENCE) {
            Sequence sds = (Sequence) v;
            ArraySequence data = (ArraySequence) sdata.getArray(m);
            processSequence(sds, data.getStructureDataIterator(), counter);
          }
        }
        indent.decr();
      }
    } finally {
      sdataIter.close();
    }

    indent.decr();
  }
private void processSequence ( Structure s , StructureDataIterator sdataIter , Counter counter ) throws IOException { indent . incr ( ) ; int count = 0 ; try { while ( sdataIter . hasNext ( ) ) { if ( showData ) out . format ( "%sSequence %s count=%d%n" , indent , s . getShortName ( ) , count ++ ) ; StructureData sdata = sdataIter . next ( ) ; indent . incr ( ) ; for ( StructureMembers . Member m : sdata . getMembers ( ) ) { Variable v = s . findVariable ( m . getName ( ) ) ; if ( m . getDataType ( ) . isString ( ) || m . getDataType ( ) . isNumeric ( ) ) { processVariable ( v , sdata . getArray ( m ) , counter ) ; } else if ( m . getDataType ( ) == DataType . STRUCTURE ) { Structure sds = ( Structure ) v ; ArrayStructure data = ( ArrayStructure ) sdata . getArray ( m ) ; processSequence ( sds , data . getStructureDataIterator ( ) , counter ) ; } else if ( m . getDataType ( ) == DataType . SEQUENCE ) { Sequence sds = ( Sequence ) v ; ArraySequence data = ( ArraySequence ) sdata . getArray ( m ) ; processSequence ( sds , data . getStructureDataIterator ( ) , counter ) ; } } indent . decr ( ) ; } } finally { sdataIter . close ( ) ; } indent . decr ( ) ; }
iterate through the observations