public class Membership
extends java.lang.Object
implements java.lang.Cloneable
Modifier and Type | Field and Description |
---|---|
protected static org.apache.commons.logging.Log |
log |
Constructor and Description |
---|
Membership()
Public constructor
Creates a member ship object with zero members
|
Membership(java.util.Collection<Address> initial_members)
Creates a member ship object with the initial members.
|
Modifier and Type | Method and Description |
---|---|
void |
add(Address new_member)
Adds a new member to this membership.
|
void |
add(java.util.Collection<Address> v)
Adds a list of members to this membership
|
void |
clear()
removes all the members from this membership
|
java.lang.Object |
clone() |
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
|
java.util.Vector<Address> |
getMembers()
returns a copy (clone) of the members in this membership.
|
void |
merge(java.util.Collection<Address> new_mems,
java.util.Collection<Address> suspects)
merges membership with the new members and removes suspects
The Merge method will remove all the suspects and add in the new members.
|
void |
remove(Address old_member)
removes an member from the membership.
|
void |
remove(java.util.Collection<Address> v)
removes all the members contained in v from this membership
|
void |
set(java.util.Collection<Address> v)
Clear 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. |
void |
set(Membership m)
Clear 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. |
int |
size()
Returns the number of addresses in this membership
|
void |
sort() |
java.lang.String |
toString() |
public Membership()
public Membership(java.util.Collection<Address> initial_members)
initial_members
- - a list of members that belong to this membershippublic java.util.Vector<Address> getMembers()
public void add(Address new_member)
public final void add(java.util.Collection<Address> v)
v
- - a vector containing Address objectsjava.lang.ClassCastException
- if v contains objects that don't implement the Address interfaceadd(org.jgroups.Address)
public void remove(Address old_member)
old_member
- - the member to be removedpublic void remove(java.util.Collection<Address> v)
v
- - a vector containing all the members to be removedpublic void clear()
public void set(java.util.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 void set(Membership m)
Clear
method.
Then it will add all the all members provided in the vector vm
- - a membership containing all the members this membership will containpublic void merge(java.util.Collection<Address> new_mems, java.util.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 void sort()
public Membership copy()
public java.lang.Object clone()
clone
in class java.lang.Object
public int size()
public Address elementAt(int index)
index
- - 0..size()-1java.lang.ArrayIndexOutOfBoundsException
- - if the index is negative or not less than the current size of this Membership object.Vector.elementAt(int)
public java.lang.String toString()
toString
in class java.lang.Object
Copyright ? 1998-2008 Bela Ban. All Rights Reserved.