public Map < String , List < Integer > > getExpandedItemIdIndexMap ( ) { // CLIENT MODE is include ALL boolean expandedOnly = getExpandMode ( ) != ExpandMode . CLIENT ; if ( getScratchMap ( ) == null ) { if ( getCustomTree ( ) == null ) { return createItemIdIndexMap ( expandedOnly ) ; } else { return createExpandedCustomIdIndexMapping ( expandedOnly ) ; } } Map < String , List < Integer > > map = ( Map < String , List < Integer > > ) getScratchMap ( ) . get ( EXPANDED_IDS_TO_INDEX_MAPPING_SCRATCH_MAP_KEY ) ; if ( map == null ) { if ( getCustomTree ( ) == null ) { map = createItemIdIndexMap ( expandedOnly ) ; } else { map = createExpandedCustomIdIndexMapping ( expandedOnly ) ; } getScratchMap ( ) . put ( EXPANDED_IDS_TO_INDEX_MAPPING_SCRATCH_MAP_KEY , map ) ; } return map ; }
Map expanded item ids to their row index . As this can be expensive save the map onto the scratch pad .