public void registerBuilder ( int type , ADStructureBuilder builder ) { if ( type < 0 || 0xFF < type ) { String message = String . format ( "'type' is out of the valid range: %d" , type ) ; throw new IllegalArgumentException ( message ) ; } if ( builder == null ) { return ; } // Use the AD type as the key for the builder. Integer key = Integer . valueOf ( type ) ; // Get the existing list of builders for the AD type. List < ADStructureBuilder > builders = mBuilders . get ( key ) ; // If no builder has been registered for the AD type yet. if ( builders == null ) { builders = new ArrayList < ADStructureBuilder > ( ) ; mBuilders . put ( key , builders ) ; } // Register the builder at the beginning of the builder list. builders . add ( 0 , builder ) ; }
Register an AD structure builder for the AD type . The given builder is added at the beginning of the list of the builders for the AD type .