public void setLevels(List<String> levels, List<Integer> codes, boolean isOrdered) throws DDFException {
    if (levels == null || levels.isEmpty()) throw new DDFException("Levels cannot be null or empty");
    if (codes != null && codes.size() != levels.size()) throw new DDFException(String.format(
        "The number of levels is %d which does not match the number of codes %d", levels.size(), codes.size()));

    if (mLevelMap == null) mLevelMap = this.instantiateSynchronizedLevelMap();

    if (codes == null) {
      // Auto-create a 1-based level-code map
      codes = new ArrayList<Integer>();
      for (int i = 1; i <= levels.size(); i++) {
        codes.add(i);
      }
    }

    Iterator<String> levelIter = levels.iterator();
    Iterator<Integer> codeIter = codes.iterator();
    while (levelIter.hasNext()) {
      mLevelMap.put(levelIter.next(), codeIter.next());
    }
    this.mLevels = new ArrayList<String>(levels);
    this.setOrdered(isOrdered);
  }
public void setLevels ( List < String > levels , List < Integer > codes , boolean isOrdered ) throws DDFException { if ( levels == null || levels . isEmpty ( ) ) throw new DDFException ( "Levels cannot be null or empty" ) ; if ( codes != null && codes . size ( ) != levels . size ( ) ) throw new DDFException ( String . format ( "The number of levels is %d which does not match the number of codes %d" , levels . size ( ) , codes . size ( ) ) ) ; if ( mLevelMap == null ) mLevelMap = this . instantiateSynchronizedLevelMap ( ) ; if ( codes == null ) { codes = new ArrayList < Integer > ( ) ; for ( int i = 1 ; i <= levels . size ( ) ; i ++ ) { codes . add ( i ) ; } } Iterator < String > levelIter = levels . iterator ( ) ; Iterator < Integer > codeIter = codes . iterator ( ) ; while ( levelIter . hasNext ( ) ) { mLevelMap . put ( levelIter . next ( ) , codeIter . next ( ) ) ; } this . mLevels = new ArrayList < String > ( levels ) ; this . setOrdered ( isOrdered ) ; }
Similar to setLevels(levels, isOrdered),

@param levels
@param codes
@param isOrdered a flag indicating whether the levels actually have "less than" and "greater than" left-to-right order
meaning
@throws DDFException