cdm/src/main/java/ucar/nc2/ncml/Aggregation.java
protected Dataset getTypicalDataset() throws IOException {
    List<Dataset> nestedDatasets = getDatasets();
    int n = nestedDatasets.size();
    if (n == 0)
      throw new FileNotFoundException("No datasets in this aggregation");

    int select;
    if (typicalDatasetMode == TypicalDataset.LATEST)
      select = n - 1;
    else if (typicalDatasetMode == TypicalDataset.PENULTIMATE)
      select = (n < 2) ? 0 : n - 2;
    else if (typicalDatasetMode == TypicalDataset.FIRST)
      select = 0;
    else { // random is default
      if (r == null) r = new Random();
      select = (n < 2) ? 0 : r.nextInt(n);
    }

    return nestedDatasets.get(select);
  }
protected Dataset getTypicalDataset() throws IOException {
    List<Dataset> nestedDatasets = getDatasets();
    int n = nestedDatasets.size();
    if (n == 0)
      throw new FileNotFoundException("No datasets in this aggregation");

    int select;
    if (typicalDatasetMode == TypicalDataset.LATEST)
      select = n - 1;
    else if (typicalDatasetMode == TypicalDataset.PENULTIMATE)
      select = (n < 2) ? 0 : n - 2;
    else if (typicalDatasetMode == TypicalDataset.FIRST)
      select = 0;
    else { // random is default
      if (r == null) r = new Random();
      select = (n < 2) ? 0 : r.nextInt(n);
    }

    return nestedDatasets.get(select);
  }
protected Dataset getTypicalDataset ( ) throws IOException { List < Dataset > nestedDatasets = getDatasets ( ) ; int n = nestedDatasets . size ( ) ; if ( n == 0 ) throw new FileNotFoundException ( "No datasets in this aggregation" ) ; int select ; if ( typicalDatasetMode == TypicalDataset . LATEST ) select = n - 1 ; else if ( typicalDatasetMode == TypicalDataset . PENULTIMATE ) select = ( n < 2 ) ? 0 : n - 2 ; else if ( typicalDatasetMode == TypicalDataset . FIRST ) select = 0 ; else { // random is default
 if ( r == null ) r = new Random ( ) ; select = ( n < 2 ) ? 0 : r . nextInt ( n ) ; } return nestedDatasets . get ( select ) ; }
Open one of the nested datasets as a template for the aggregation dataset.

@return a typical Dataset
@throws IOException if there are no datasets
Open one of the nested datasets as a template for the aggregation dataset .