private < T > void visitFractions ( Container container , T context , FractionProcessor < T > fn ) { OUTER : for ( ServerConfiguration eachConfig : this . configList ) { boolean found = false ; INNER : for ( Fraction eachFraction : container . fractions ( ) ) { if ( eachConfig . getType ( ) . isAssignableFrom ( eachFraction . getClass ( ) ) ) { found = true ; fn . accept ( context , eachConfig , eachFraction ) ; break INNER ; } } if ( ! found && ! eachConfig . isIgnorable ( ) ) { System . err . println ( "*** unable to find fraction for: " + eachConfig . getType ( ) ) ; } } }
Wraps common iteration pattern over fraction and server configurations