public HashMap < Integer , List < Integer > > getPair_PositionList_Table ( byte [ ] fingerprint ) { List < int [ ] > pairPositionList = getPairPositionList ( fingerprint ) ; // table to store pair:pos,pos,pos,...;pair2:pos,pos,pos,.... HashMap < Integer , List < Integer > > pair_positionList_table = new HashMap <> ( ) ; // get all pair_positions from list, use a table to collect the data group by pair hashcode for ( int [ ] pair_position : pairPositionList ) { //System.out.println(pair_position[0]+","+pair_position[1]); // group by pair-hashcode, i.e.: <pair,List<position>> if ( pair_positionList_table . containsKey ( pair_position [ 0 ] ) ) { pair_positionList_table . get ( pair_position [ 0 ] ) . add ( pair_position [ 1 ] ) ; } else { List < Integer > positionList = new LinkedList <> ( ) ; positionList . add ( pair_position [ 1 ] ) ; pair_positionList_table . put ( pair_position [ 0 ] , positionList ) ; } // end group by pair-hashcode, i.e.: <pair,List<position>> } // end get all pair_positions from list, use a table to collect the data group by pair hashcode return pair_positionList_table ; }
Get a pair - positionList table It s a hash map which the key is the hashed pair and the value is list of positions That means the table stores the positions which have the same hashed pair