jill/src/main/java/io/github/agentsoz/jill/lang/PlanBindings.java
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();
    }
  }
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();
    }
  }
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.

@param plan the plan type
@param planBindings the available bindings
Add the set of bindings for a given plan to this store . Any previously stored bindings for this plan will be replaced .