static SortedSet<String> createStatsItems(String statsType)
      throws IOException {
    SortedSet<String> statsItems = new TreeSet<>();
    SortedSet<String> functionItems = new TreeSet<>();
    if (statsType != null) {
      Matcher m = fpStatsItems.matcher(statsType.trim());
      while (m.find()) {
        String tmpStatsItem = m.group(2).trim();
        if (STATS_TYPES.contains(tmpStatsItem)) {
          statsItems.add(tmpStatsItem);
        } else if (tmpStatsItem.equals(STATS_TYPE_ALL)) {
          for (String type : STATS_TYPES) {
            statsItems.add(type);
          }
        } else if (STATS_FUNCTIONS.contains(tmpStatsItem)) {
          if (m.group(3) == null) {
            throw new IOException("'" + tmpStatsItem + "' should be called as '"
                + tmpStatsItem + "()' with an optional argument");
          } else {
            functionItems.add(m.group(1).trim());
          }
        } else {
          throw new IOException("unknown statsType '" + tmpStatsItem + "'");
        }
      }
    }
    if (statsItems.size() == 0 && functionItems.size() == 0) {
      statsItems.add(STATS_TYPE_SUM);
      statsItems.add(STATS_TYPE_N);
      statsItems.add(STATS_TYPE_MEAN);
    }
    if (functionItems.size() > 0) {
      statsItems.addAll(functionItems);
    }
    return statsItems;
  }
static SortedSet < String > createStatsItems ( String statsType ) throws IOException { SortedSet < String > statsItems = new TreeSet < > ( ) ; SortedSet < String > functionItems = new TreeSet < > ( ) ; if ( statsType != null ) { Matcher m = fpStatsItems . matcher ( statsType . trim ( ) ) ; while ( m . find ( ) ) { String tmpStatsItem = m . group ( 2 ) . trim ( ) ; if ( STATS_TYPES . contains ( tmpStatsItem ) ) { statsItems . add ( tmpStatsItem ) ; } else if ( tmpStatsItem . equals ( STATS_TYPE_ALL ) ) { for ( String type : STATS_TYPES ) { statsItems . add ( type ) ; } } else if ( STATS_FUNCTIONS . contains ( tmpStatsItem ) ) { if ( m . group ( 3 ) == null ) { throw new IOException ( "'" + tmpStatsItem + "' should be called as '" + tmpStatsItem + "()' with an optional argument" ) ; } else { functionItems . add ( m . group ( 1 ) . trim ( ) ) ; } } else { throw new IOException ( "unknown statsType '" + tmpStatsItem + "'" ) ; } } } if ( statsItems . size ( ) == 0 && functionItems . size ( ) == 0 ) { statsItems . add ( STATS_TYPE_SUM ) ; statsItems . add ( STATS_TYPE_N ) ; statsItems . add ( STATS_TYPE_MEAN ) ; } if ( functionItems . size ( ) > 0 ) { statsItems . addAll ( functionItems ) ; } return statsItems ; }
Creates the stats items.

@param statsType
the stats type
@return the sorted set
@throws IOException
Signals that an I/O exception has occurred.