protected int mapIdRefToInternalScanNum ( CharArray id ) throws FileParsingException { String idStr = id . toString ( ) ; MZMLIndexElement byId = index . getById ( idStr ) ; if ( byId == null ) { String msg = String . format ( "Could not find a mapping from spectrum id" + " ref to an internal scan number for" + "\n\t file: %s" + "\n\t spectrum index of the spectrum in which the error occured: #%d" + "\n\t idRef searched for: %s" , source . getPath ( ) , vars . spectrumIndex , idStr ) ; throw new FileParsingException ( msg ) ; } return byId . getNumber ( ) ; }
Given a scan ID goes to the index and tries to find a mapping .