private Mode lookupCreateMode ( String name ) { if ( name == null ) return null ; name = name . trim ( ) ; Mode mode = ( Mode ) modeMap . get ( name ) ; if ( mode == null ) { mode = new Mode ( name , defaultBaseMode ) ; modeMap . put ( name , mode ) ; } return mode ; }
Gets a mode with the given name from the mode map . If not present then it creates a new mode extending the default base mode .