private ImmutableMap<Predicate,ImmutableList<TermType>> extractCastTypeMap(
            Multimap<Predicate, CQIE> ruleIndex, List<Predicate> predicatesInBottomUp,
            ImmutableMap<CQIE, ImmutableList<Optional<TermType>>> termTypeMap, DBMetadata metadata) {

        // Append-only
        Map<Predicate,ImmutableList<TermType>> mutableCastMap = Maps.newHashMap();

        for (Predicate predicate : predicatesInBottomUp) {
            ImmutableList<TermType> castTypes = inferCastTypes(predicate, ruleIndex.get(predicate), termTypeMap,
                    mutableCastMap,metadata);

            mutableCastMap.put(predicate, castTypes);
        }

        return ImmutableMap.copyOf(mutableCastMap);
    }
private ImmutableMap < Predicate , ImmutableList < TermType > > extractCastTypeMap ( Multimap < Predicate , CQIE > ruleIndex , List < Predicate > predicatesInBottomUp , ImmutableMap < CQIE , ImmutableList < Optional < TermType > > > termTypeMap , DBMetadata metadata ) { Map < Predicate , ImmutableList < TermType > > mutableCastMap = Maps . newHashMap ( ) ; for ( Predicate predicate : predicatesInBottomUp ) { ImmutableList < TermType > castTypes = inferCastTypes ( predicate , ruleIndex . get ( predicate ) , termTypeMap , mutableCastMap , metadata ) ; mutableCastMap . put ( predicate , castTypes ) ; } return ImmutableMap . copyOf ( mutableCastMap ) ; }
Infers cast types for each predicate in the bottom up order