public void add ( Plan plan , Set < Belief > planBindings ) { if ( plan == null ) { return ; } // remove any old bindings, making sure to decrement the cached size if ( this . bindings . containsKey ( plan ) ) { Set < Belief > oldBindings = this . bindings . remove ( plan ) ; if ( oldBindings == null || oldBindings . isEmpty ( ) ) { cachedsize -- ; } else { cachedsize -= oldBindings . size ( ) ; } } // add this binding and update the cached size this . bindings . put ( plan , planBindings ) ; if ( planBindings == null || planBindings . isEmpty ( ) ) { cachedsize ++ ; } else { cachedsize += planBindings . size ( ) ; } }
Add the set of bindings for a given plan to this store . Any previously stored bindings for this plan will be replaced .