public void loadTraces(Reader r) throws TraceException, java.io.IOException {
  TrimLineReader reader=new LogFileTraces.TrimLineReader(r);
  StringTokenizer tokens=reader.tokenizeLine();
  if (tokens == null) {
    throw new TraceException("Trace file is empty.");
  }
  while (!tokens.hasMoreTokens()) {
    tokens=reader.tokenizeLine();
  }
  String token=tokens.nextToken();
  while (token.startsWith("[") || token.startsWith("#")) {
    readTraceType(token,tokens);
    tokens=reader.tokenizeLine();
    while (!tokens.hasMoreTokens()) {
      tokens=reader.tokenizeLine();
    }
    token=tokens.nextToken();
  }
  String[] labels=new String[tokens.countTokens()];
  for (int i=0; i < labels.length; i++) {
    labels[i]=tokens.nextToken();
    addTraceAndType(labels[i]);
  }
  int traceCount=getTraceCount();
  boolean firstState=true;
  tokens=reader.tokenizeLine();
  while (tokens != null && tokens.hasMoreTokens()) {
    String stateString=tokens.nextToken();
    long state=0;
    try {
      try {
        state=(long)Double.parseDouble(stateString);
      }
 catch (      NumberFormatException nfe) {
        throw new TraceException("Unable to parse state number in column 1 (Line " + reader.getLineNumber() + ")");
      }
      if (firstState) {
        if (state == 1)         state=0;
        firstState=false;
      }
      if (!addState(state)) {
        throw new TraceException("State " + state + " is not consistent with previous spacing (Line "+ reader.getLineNumber()+ ")");
      }
    }
 catch (    NumberFormatException nfe) {
      throw new TraceException("State " + state + ":Expected real value in column "+ reader.getLineNumber());
    }
    for (int i=0; i < traceCount; i++) {
      if (tokens.hasMoreTokens()) {
        String value=tokens.nextToken();
        if (state == 0)         assignTraceTypeAccordingValue(value);
        try {
          addParsedValue(i,value);
        }
 catch (        NumberFormatException nfe) {
          throw new TraceException("State " + state + ": Expected correct number type (Double, Integer or String) in column "+ (i + 1)+ " (Line "+ reader.getLineNumber()+ ")");
        }
      }
 else {
        throw new TraceException("State " + state + ": missing values at line "+ reader.getLineNumber());
      }
    }
    tokens=reader.tokenizeLine();
  }
  burnIn=(int)(0.1 * lastState);
}

public void loadTraces ( Reader r ) throws TraceException , java . io . IOException { TrimLineReader reader = new LogFileTraces . TrimLineReader ( r ) ; StringTokenizer tokens = reader . tokenizeLine ( ) ; if ( tokens == null ) { throw new TraceException ( "Trace file is empty." ) ; } while ( ! tokens . hasMoreTokens ( ) ) { tokens = reader . tokenizeLine ( ) ; } String token = tokens . nextToken ( ) ; while ( token . startsWith ( "[" ) || token . startsWith ( "#" ) ) { readTraceType ( token , tokens ) ; tokens = reader . tokenizeLine ( ) ; while ( ! tokens . hasMoreTokens ( ) ) { tokens = reader . tokenizeLine ( ) ; } token = tokens . nextToken ( ) ; } String [ ] labels = new String [ tokens . countTokens ( ) ] ; for ( int i = 0 ; i < labels . length ; i ++ ) { labels [ i ] = tokens . nextToken ( ) ; addTraceAndType ( labels [ i ] ) ; } int traceCount = getTraceCount ( ) ; boolean firstState = true ; tokens = reader . tokenizeLine ( ) ; while ( tokens != null && tokens . hasMoreTokens ( ) ) { String stateString = tokens . nextToken ( ) ; long state = 0 ; try { try { state = ( long ) Double . parseDouble ( stateString ) ; } catch ( NumberFormatException nfe ) { throw new TraceException ( "Unable to parse state number in column 1 (Line " + reader . getLineNumber ( ) + ")" ) ; } if ( firstState ) { if ( state == 1 ) state = 0 ; firstState = false ; } if ( ! addState ( state ) ) { throw new TraceException ( "State " + state + " is not consistent with previous spacing (Line " + reader . getLineNumber ( ) + ")" ) ; } } catch ( NumberFormatException nfe ) { throw new TraceException ( "State " + state + ":Expected real value in column " + reader . getLineNumber ( ) ) ; } for ( int i = 0 ; i < traceCount ; i ++ ) { if ( tokens . hasMoreTokens ( ) ) { String value = tokens . nextToken ( ) ; if ( state == 0 ) assignTraceTypeAccordingValue ( value ) ; try { addParsedValue ( i , value ) ; } catch ( NumberFormatException nfe ) { throw new TraceException ( "State " + state + ": Expected correct number type (Double, Integer or String) in column " + ( i + 1 ) + " (Line " + reader . getLineNumber ( ) + ")" ) ; } } else { throw new TraceException ( "State " + state + ": missing values at line " + reader . getLineNumber ( ) ) ; } } tokens = reader . tokenizeLine ( ) ; } burnIn = ( int ) ( 0.1 * lastState ) ; }
walter : please comment what the extra arguments mean
