public class Membership extends Object
Constructor and Description |
---|
Membership()
Creates a member ship object with zero members
|
Membership(Address... initial_members) |
Membership(Collection<Address> initial_members)
Creates a Membership with a given initial members.
|
Modifier and Type | Method and Description |
---|---|
Membership |
add(Address... mbrs) |
Membership |
add(Address new_member)
Adds a new member to this membership.
|
Membership |
add(Collection<Address> v)
Adds a list of members to this membership
|
Membership |
clear()
Removes all the members from this membership
|
boolean |
contains(Address member)
Returns true if the provided member belongs to this membership
|
Membership |
copy()
Returns a copy of this membership
|
Address |
elementAt(int index)
Returns the component at the specified index
|
List<Address> |
getMembers()
Returns a copy (clone) of the members in this membership.
|
Membership |
merge(Collection<Address> new_mems,
Collection<Address> suspects)
Merges membership with the new members and removes suspects.
|
Membership |
remove(Address old_member)
Removes an member from the membership.
|
Membership |
remove(Collection<Address> v)
Removes all the members contained in v from this membership
|
Membership |
retainAll(Collection<Address> v) |
Membership |
set(Collection<Address> v)
Clears the membership and adds all members of v This method will clear out all the old members
of this membership by invoking the
Clear method. |
Membership |
set(Membership m)
Clears the membership and adds all members of a given membership parameter.
|
int |
size()
Returns the number of addresses in this membership
|
Membership |
sort() |
String |
toString() |
public Membership()
public Membership(Collection<Address> initial_members)
initial_members
- a list of members that belong to this membershippublic Membership(Address... initial_members)
public List<Address> getMembers()
public Membership add(Address new_member)
public Membership add(Address... mbrs)
public Membership add(Collection<Address> v)
v
- - a listof addressesClassCastException
- if v contains objects that don't implement the Address interfacepublic Membership remove(Address old_member)
old_member
- - the member to be removedpublic Membership remove(Collection<Address> v)
v
- a list of all the members to be removedpublic Membership retainAll(Collection<Address> v)
public Membership clear()
public Membership set(Collection<Address> v)
Clear
method. Then it will add all the all
members provided in the vector vv
- - a vector containing all the members this membership will containpublic Membership set(Membership m)
clear
method.m
- a membership containing all the members this membership will containpublic Membership merge(Collection<Address> new_mems, Collection<Address> suspects)
new_mems
- - a vector containing a list of members (Address) to be added to this membershipsuspects
- - a vector containing a list of members (Address) to be removed from this membershippublic boolean contains(Address member)
member
- public Membership sort()
public Membership copy()
public int size()
public Address elementAt(int index)
index
- - 0..size()-1ArrayIndexOutOfBoundsException
- - if the index is negative or not less than the current size of this Membership
object.Copyright © 2018 JBoss, a division of Red Hat. All rights reserved.