/** * Merges membership with the new members and removes suspects. * The Merge method will remove all the suspects and add in the new members. * It will do it in the order * 1. Remove suspects * 2. Add new members * the order is very important to notice. * * @param new_mems - a vector containing a list of members (Address) to be added to this membership * @param suspects - a vector containing a list of members (Address) to be removed from this membership */ public Membership merge(Collection<Address> new_mems, Collection<Address> suspects) { remove(suspects); return add(new_mems); }
/** * Takes the existing membership list and removes suspected and left members, then adds new * members to the end of the list * @param current_members The list of current members. Guaranteed to be non-null (but may be empty) * @param joiners The joining members. Guaranteed to be non-null (but may be empty) * @param leavers Members that are leaving. Guaranteed to be non-null (but may be empty) * @param suspects Members which are suspected. Guaranteed to be non-null (but may be empty) * @return The new membership. Needs to be non-null and cannot contain duplicates */ public List<Address> getNewMembership(final Collection<Address> current_members, final Collection<Address> joiners, final Collection<Address> leavers, final Collection<Address> suspects) { Membership mbrs=new Membership(current_members).remove(leavers).remove(suspects).add(joiners); return mbrs.getMembers(); }
tmp_members.remove(leaving); // remove members that haven't yet been removed from the membership
/** * merges membership with the new members and removes suspects * The Merge method will remove all the suspects and add in the new members. * It will do it in the order * 1. Remove suspects * 2. Add new members * the order is very important to notice. * * @param new_mems - a vector containing a list of members (Address) to be added to this membership * @param suspects - a vector containing a list of members (Address) to be removed from this membership */ public void merge(Collection new_mems, Collection suspects) { remove(suspects); add(new_mems); }
/** * Merges membership with the new members and removes suspects. * The Merge method will remove all the suspects and add in the new members. * It will do it in the order * 1. Remove suspects * 2. Add new members * the order is very important to notice. * * @param new_mems - a vector containing a list of members (Address) to be added to this membership * @param suspects - a vector containing a list of members (Address) to be removed from this membership */ public Membership merge(Collection<Address> new_mems, Collection<Address> suspects) { remove(suspects); return add(new_mems); }
/** * Takes the existing membership list and removes suspected and left members, then adds new * members to the end of the list * @param current_members The list of current members. Guaranteed to be non-null (but may be empty) * @param joiners The joining members. Guaranteed to be non-null (but may be empty) * @param leavers Members that are leaving. Guaranteed to be non-null (but may be empty) * @param suspects Members which are suspected. Guaranteed to be non-null (but may be empty) * @return The new membership. Needs to be non-null and cannot contain duplicates */ public List<Address> getNewMembership(final Collection<Address> current_members, final Collection<Address> joiners, final Collection<Address> leavers, final Collection<Address> suspects) { Membership mbrs=new Membership(current_members).remove(leavers).remove(suspects).add(joiners); return mbrs.getMembers(); }
tmp_members.remove(leaving); // remove members that haven't yet been removed from the membership
tmp_members.remove(leaving); // remove members that haven't yet been removed from the membership