private int mapRawNumToInternalScanNum(int rawScanNum) throws FileParsingException {
    MZXMLIndexElement byRawNum = index.getByRawNum(rawScanNum);
    if (byRawNum == null) {
      String msg = String.format("Could not find a mapping from spectrum index"
              + " ref to an internal scan number for"
              + "\n\t file: %s"
              + "\n\t raw scan num searched for: #%d"
              + "\n\t raw scan num of the spectrum in which the error occured: #%d"
          , source.getPath(), rawScanNum, vars.scanNumRaw);
      throw new FileParsingException(msg);
    }
    return byRawNum.getNumber();
  }
private int mapRawNumToInternalScanNum ( int rawScanNum ) throws FileParsingException { MZXMLIndexElement byRawNum = index . getByRawNum ( rawScanNum ) ; if ( byRawNum == null ) { String msg = String . format ( "Could not find a mapping from spectrum index" + " ref to an internal scan number for" + "\n\t file: %s" + "\n\t raw scan num searched for: #%d" + "\n\t raw scan num of the spectrum in which the error occured: #%d" , source . getPath ( ) , rawScanNum , vars . scanNumRaw ) ; throw new FileParsingException ( msg ) ; } return byRawNum . getNumber ( ) ; }
Given a scan internal number (spectrum index) goes to the index and tries to find a mapping.

@param rawScanNum the number as is in the scan tag