private int addRuleContainer ( SpatialRuleContainer container ) { int newIndex = this . ruleContainers . indexOf ( container ) ; if ( newIndex >= 0 ) return newIndex ; newIndex = ruleContainers . size ( ) ; if ( newIndex >= 255 ) throw new IllegalStateException ( "No more spatial rule container fit into this lookup as 255 combination of ruleContainers reached" ) ; this . ruleContainers . add ( container ) ; return newIndex ; }
This method adds the container if no such rule container exists in this lookup and returns the index otherwise .