public class View extends java.lang.Object implements java.io.Externalizable, java.lang.Cloneable, Streamable
| Modifier and Type | Field and Description |
|---|---|
protected java.util.Vector<Address> |
members
A list containing all the members of the view
This list is always ordered, with the coordinator being the first member.
|
protected java.util.Map<java.lang.String,java.lang.Object> |
payload |
protected ViewId |
vid |
| Constructor and Description |
|---|
View()
creates an empty view, should not be used
|
View(Address creator,
long id,
java.util.Vector<Address> members)
Creates a new view
|
View(ViewId vid,
java.util.Vector<Address> members)
Creates a new view
|
| Modifier and Type | Method and Description |
|---|---|
void |
addPayload(java.lang.String key,
java.lang.Object value)
Adds a key and value to the view.
|
java.lang.Object |
clone()
creates a copy of this view
|
boolean |
containsMember(Address mbr)
returns true, if this view contains a certain member
|
boolean |
equals(java.lang.Object obj) |
Address |
getCreator()
returns the creator of this view
if this view was created with the empty constructur, null will be returned
|
java.util.Vector<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.
|
java.lang.Object |
getPayload(java.lang.String key) |
ViewId |
getVid()
returns the view ID of this view
if this view was created with the empty constructur, null will be returned
|
int |
hashCode() |
java.lang.String |
printDetails()
debug only
|
void |
readExternal(java.io.ObjectInput in) |
void |
readFrom(java.io.DataInputStream 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
|
java.lang.String |
toString() |
void |
writeExternal(java.io.ObjectOutput out) |
void |
writeTo(java.io.DataOutputStream out)
Write the entire state of the current object (including superclasses) to outstream.
|
protected ViewId vid
protected java.util.Vector<Address> members
protected java.util.Map<java.lang.String,java.lang.Object> payload
public View()
public View(ViewId vid, java.util.Vector<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 Address getCreator()
public java.util.Vector<Address> getMembers()
public boolean containsMember(Address mbr)
mbr - - the address of the member,public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic int size()
public java.lang.Object clone()
clone in class java.lang.Objectpublic java.lang.String printDetails()
public void addPayload(java.lang.String key,
java.lang.Object value)
key - value - public java.lang.Object getPayload(java.lang.String key)
public java.lang.String toString()
toString in class java.lang.Objectpublic void writeExternal(java.io.ObjectOutput out)
throws java.io.IOException
writeExternal in interface java.io.Externalizablejava.io.IOExceptionpublic void readExternal(java.io.ObjectInput in)
throws java.io.IOException,
java.lang.ClassNotFoundException
readExternal in interface java.io.Externalizablejava.io.IOExceptionjava.lang.ClassNotFoundExceptionpublic void writeTo(java.io.DataOutputStream out)
throws java.io.IOException
StreamablewriteTo in interface Streamablejava.io.IOExceptionpublic void readFrom(java.io.DataInputStream in)
throws java.io.IOException,
java.lang.IllegalAccessException,
java.lang.InstantiationException
StreamablereadFrom in interface Streamablejava.io.IOExceptionjava.lang.IllegalAccessExceptionjava.lang.InstantiationExceptionpublic int serializedSize()
Copyright ? 1998-2008 Bela Ban. All Rights Reserved.