private void captureLabels ( Step < ? , ? > step , Map < String , Object > stepsByLabel ) { for ( String s : step . getLabels ( ) ) { stepsByLabel . put ( s , step ) ; } // labels on replaced steps are not bubbled up to the graphstep if ( step instanceof SqlgGraphStep < ? , ? > ) { SqlgGraphStep < ? , ? > sgs = ( SqlgGraphStep < ? , ? > ) step ; for ( ReplacedStep < ? , ? > rs : sgs . getReplacedSteps ( ) ) { for ( String label : rs . getLabels ( ) ) { if ( label . contains ( BaseStrategy . PATH_LABEL_SUFFIX ) ) { stepsByLabel . put ( label . substring ( label . indexOf ( BaseStrategy . PATH_LABEL_SUFFIX ) + BaseStrategy . PATH_LABEL_SUFFIX . length ( ) ) , rs ) ; } else if ( label . contains ( BaseStrategy . EMIT_LABEL_SUFFIX ) ) { stepsByLabel . put ( label . substring ( label . indexOf ( BaseStrategy . EMIT_LABEL_SUFFIX ) + BaseStrategy . EMIT_LABEL_SUFFIX . length ( ) ) , rs ) ; } } } } }
add all labels for the step in the given map