|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jgroups.Membership
public class Membership
Class to keep track of Addresses. The membership object holds a vector of Address objects that are in the same membership. Each unique address can only exist once; i.e., doing Membership.add(existing_address) will be ignored.
Field Summary | |
---|---|
protected static org.apache.commons.logging.Log |
log
|
Constructor Summary | |
---|---|
Membership()
Public constructor Creates a member ship object with zero members |
|
Membership(java.util.Collection initial_members)
Creates a member ship object with the initial members. |
Method Summary | |
---|---|
void |
add(Address new_member)
Adds a new member to this membership. |
void |
add(java.util.Collection 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 |
java.lang.Object |
elementAt(int index)
Returns the component at the specified index |
java.util.Vector |
getMembers()
returns a copy (clone) of the members in this membership. |
void |
merge(java.util.Collection new_mems,
java.util.Collection 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 v)
removes all the members contained in v from this membership |
void |
set(java.util.Collection 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()
|
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected static final org.apache.commons.logging.Log log
Constructor Detail |
---|
public Membership()
public Membership(java.util.Collection initial_members)
initial_members
- - a list of members that belong to this membershipMethod Detail |
---|
public java.util.Vector getMembers()
public void add(Address new_member)
public final void add(java.util.Collection v)
v
- - a vector containing Address objects
java.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 v)
v
- - a vector containing all the members to be removedpublic void clear()
public void set(java.util.Collection v)
Clear
method.
Then it will add all the all members provided in the vector v
v
- - 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 v
m
- - a membership containing all the members this membership will containpublic void merge(java.util.Collection new_mems, java.util.Collection 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 java.lang.Object elementAt(int index)
index
- - 0..size()-1
java.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
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |