public class View extends Object implements Comparable<View>, Streamable, Iterable<Address>
| Modifier and Type | Field and Description |
|---|---|
protected List<Address> |
members
A list containing all the members of the view.This list is always ordered, with the
coordinator being the first member.
|
protected ViewId |
vid
A view is uniquely identified by its ViewID.
|
| Constructor and Description |
|---|
View()
Creates an empty view, should not be used, only used by (de-)serialization
|
View(Address creator,
long id,
List<Address> members)
Creates a new view
|
View(ViewId vid,
List<Address> members)
Creates a new view
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(View o) |
boolean |
containsMember(Address mbr)
Returns true, if this view contains a certain member
|
View |
copy() |
boolean |
equals(Object obj) |
Address |
getCreator()
Returns the creator of this view
if this view was created with the empty constructur, null will be returned
|
List<Address> |
getMembers()
Returns a reference to the List of members (ordered)
Do NOT change this list, hence your will invalidate the view
Make a copy if you have to modify it.
|
ViewId |
getVid()
Returns the view ID of this view
if this view was created with the empty constructur, null will be returned
|
ViewId |
getViewId() |
int |
hashCode() |
Iterator<Address> |
iterator() |
void |
readFrom(DataInput in)
Read the state of the current object (including superclasses) from instream
Note that the input stream must not be closed
|
int |
serializedSize() |
int |
size()
Returns the number of members in this view
|
String |
toString() |
void |
writeTo(DataOutput out)
Write the entire state of the current object (including superclasses) to outstream.
|
protected ViewId vid
public View()
public View(ViewId vid, List<Address> members)
vid - The view id of this view (can not be null)members - Contains a list of all the members in the view, can be empty but not null.public ViewId getVid()
public ViewId getViewId()
public Address getCreator()
public List<Address> getMembers()
public boolean containsMember(Address mbr)
mbr - - the address of the member,public int compareTo(View o)
compareTo in interface Comparable<View>public int size()
public View copy()
public void writeTo(DataOutput out) throws Exception
StreamablewriteTo in interface StreamableExceptionpublic void readFrom(DataInput in) throws Exception
StreamablereadFrom in interface StreamableExceptionpublic int serializedSize()
Copyright © 2012 JBoss by Red Hat. All Rights Reserved.