visad/src/main/java/ucar/nc2/iosp/grid/GridCoordSys.java
boolean matchLevels(List<GridRecord> records) {

    // first create a new list
    List<Double> levelList = new ArrayList<Double>(records.size());
    for (GridRecord record : records) {
      Double d = new Double(record.getLevel1());
      if (!levelList.contains(d)) {
        levelList.add(d);
      }
    }

    Collections.sort(levelList);
    if (positive.equals("down")) {
      Collections.reverse(levelList);
    }

    // gotta equal existing list
    return levelList.equals(levels);
  }
boolean matchLevels(List<GridRecord> records) {

    // first create a new list
    List<Double> levelList = new ArrayList<Double>(records.size());
    for (GridRecord record : records) {
      Double d = new Double(record.getLevel1());
      if (!levelList.contains(d)) {
        levelList.add(d);
      }
    }

    Collections.sort(levelList);
    if (positive.equals("down")) {
      Collections.reverse(levelList);
    }

    // gotta equal existing list
    return levelList.equals(levels);
  }
boolean matchLevels ( List < GridRecord > records ) { // first create a new list List < Double > levelList = new ArrayList < Double > ( records . size ( ) ) ; for ( GridRecord record : records ) { Double d = new Double ( record . getLevel1 ( ) ) ; if ( ! levelList . contains ( d ) ) { levelList . add ( d ) ; } } Collections . sort ( levelList ) ; if ( positive . equals ( "down" ) ) { Collections . reverse ( levelList ) ; } // gotta equal existing list return levelList . equals ( levels ) ; }
Match levels

@param records list of GridRecords
@return true if they match
Match levels