protected int[] determineIndices(int numAttributes) throws Exception {
  int[] result;
  Vector<Integer> list;
  int i;
  StringTokenizer tok;
  String token;
  String[] range;
  int from;
  int to;
  list=new Vector<Integer>();
  tok=new StringTokenizer(m_NewOrderCols,",");
  while (tok.hasMoreTokens()) {
    token=tok.nextToken();
    if (token.indexOf("-") > -1) {
      range=token.split("-");
      if (range.length != 2) {
        throw new IllegalArgumentException("'" + token + "' is not a valid range!");
      }
      from=determineIndex(range[0],numAttributes);
      to=determineIndex(range[1],numAttributes);
      if (from <= to) {
        for (i=from; i <= to; i++) {
          list.add(i);
        }
      }
 else {
        for (i=from; i >= to; i--) {
          list.add(i);
        }
      }
    }
 else {
      list.add(determineIndex(token,numAttributes));
    }
  }
  result=new int[list.size()];
  for (i=0; i < list.size(); i++) {
    result[i]=list.get(i);
  }
  return result;
}

protected int [ ] determineIndices ( int numAttributes ) throws Exception { int [ ] result ; Vector < Integer > list ; int i ; StringTokenizer tok ; String token ; String [ ] range ; int from ; int to ; list = new Vector < Integer > ( ) ; tok = new StringTokenizer ( m_NewOrderCols , "," ) ; while ( tok . hasMoreTokens ( ) ) { token = tok . nextToken ( ) ; if ( token . indexOf ( "-" ) > - 1 ) { range = token . split ( "-" ) ; if ( range . length != 2 ) { throw new IllegalArgumentException ( "'" + token + "' is not a valid range!" ) ; } from = determineIndex ( range [ 0 ] , numAttributes ) ; to = determineIndex ( range [ 1 ] , numAttributes ) ; if ( from <= to ) { for ( i = from ; i <= to ; i ++ ) { list . add ( i ) ; } } else { for ( i = from ; i >= to ; i -- ) { list . add ( i ) ; } } } else { list . add ( determineIndex ( token , numAttributes ) ) ; } } result = new int [ list . size ( ) ] ; for ( i = 0 ; i < list . size ( ) ; i ++ ) { result [ i ] = list . get ( i ) ; } return result ; }
parses the range string and returns an array with the indices
