public void readCpMaps ( BufferedReader fin ) throws IOException { if ( cpStr2Int != null ) { cpStr2Int . clear ( ) ; } else { cpStr2Int = new HashMap ( ) ; } if ( cpInt2Str != null ) { cpInt2Str . clear ( ) ; } else { cpInt2Str = new HashMap ( ) ; } String line ; // get size of context predicate map if ( ( line = fin . readLine ( ) ) == null ) { System . out . println ( "No context predicate map size information" ) ; return ; } int numCps = Integer . parseInt ( line ) ; if ( numCps <= 0 ) { System . out . println ( "Invalid mapping size" ) ; return ; } System . out . println ( "Reading the context predicate maps ..." ) ; for ( int i = 0 ; i < numCps ; i ++ ) { line = fin . readLine ( ) ; if ( line == null ) { System . out . println ( "Invalid context predicate mapping line" ) ; return ; } StringTokenizer strTok = new StringTokenizer ( line , " \t\r\n" ) ; if ( strTok . countTokens ( ) != 2 ) { continue ; } String cpStr = strTok . nextToken ( ) ; String cpInt = strTok . nextToken ( ) ; cpStr2Int . put ( cpStr , new Integer ( cpInt ) ) ; cpInt2Str . put ( new Integer ( cpInt ) , cpStr ) ; } System . out . println ( "Reading context predicate maps (" + Integer . toString ( cpStr2Int . size ( ) ) + " entries) completed!" ) ; // read the line ###... line = fin . readLine ( ) ; }
Read cp maps .