예제 #1
0
  /**
   * Sets the experimenters contained in this group.
   *
   * @param newValue The set of experimenters.
   */
  public void setExperimenters(Set<ExperimenterData> newValue) {
    Set<ExperimenterData> currentValue = getExperimenters();
    SetMutator<ExperimenterData> m = new SetMutator<ExperimenterData>(currentValue, newValue);

    while (m.moreDeletions()) {
      setDirty(true);
      asGroup().unlinkExperimenter(m.nextDeletion().asExperimenter());
    }

    while (m.moreAdditions()) {
      setDirty(true);
      asGroup().linkExperimenter(m.nextAddition().asExperimenter());
    }

    experimenters = new HashSet<ExperimenterData>(m.result());
  }