public class View extends java.lang.Object implements java.lang.Comparable<View>, Streamable, java.lang.Iterable<Address>
限定符和类型 | 字段和说明 |
---|---|
protected Address[] |
members
An array containing all the members of the view.
|
protected static boolean |
suppress_view_size |
protected ViewId |
view_id
A view is uniquely identified by its ViewID.
|
构造器和说明 |
---|
View()
Creates an empty view, should not be used, only used by (de-)serialization
|
View(Address creator,
long id,
java.util.List<Address> members)
Creates a new view
|
View(ViewId view_id,
Address[] members)
Creates a new view.
|
View(ViewId view_id,
java.util.List<Address> members)
Creates a new view
|
限定符和类型 | 方法和说明 |
---|---|
int |
compareTo(View o) |
boolean |
containsMember(Address mbr)
Returns true if this view contains a certain member
|
View |
copy()
已过时。
View is immutable, so copy() is unnecessary
|
static View |
create(Address coord,
long id,
Address... members) |
boolean |
deepEquals(View other) |
static Address[][] |
diff(View from,
View to)
Returns the difference between 2 views from and to.
|
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.List<Address> |
getMembers()
Returns the member list
|
Address[] |
getMembersRaw()
Returns the underlying array.
|
ViewId |
getVid()
已过时。
|
ViewId |
getViewId()
Returns the view ID of this view
if this view was created with the empty constructur, null will be returned
|
int |
hashCode() |
java.util.Iterator<Address> |
iterator() |
static java.util.List<Address> |
leftMembers(View one,
View two)
Returns a list of members which left from view one to two
|
void |
readFrom(java.io.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
|
java.lang.String |
toString() |
void |
writeTo(java.io.DataOutput out)
Write the entire state of the current object (including superclasses) to outstream.
|
protected ViewId view_id
protected Address[] members
protected static final boolean suppress_view_size
public View()
public View(ViewId view_id, java.util.List<Address> members)
view_id
- 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 View(ViewId view_id, Address[] members)
view_id
- The new view-idmembers
- The members. Note that the parameter is not copied.@Deprecated public ViewId getVid()
public ViewId getViewId()
public Address getCreator()
public java.util.List<Address> getMembers()
public Address[] getMembersRaw()
public boolean containsMember(Address mbr)
mbr
- - the address of the member,public boolean equals(java.lang.Object obj)
equals
在类中 java.lang.Object
public boolean deepEquals(View other)
public int hashCode()
hashCode
在类中 java.lang.Object
public int size()
@Deprecated public View copy()
public java.lang.String toString()
toString
在类中 java.lang.Object
public void writeTo(java.io.DataOutput out) throws java.lang.Exception
Streamable
writeTo
在接口中 Streamable
java.lang.Exception
public void readFrom(java.io.DataInput in) throws java.lang.Exception
Streamable
readFrom
在接口中 Streamable
java.lang.Exception
public int serializedSize()
public static java.util.List<Address> leftMembers(View one, View two)
one
- two
- public static Address[][] diff(View from, View to)
from
- The first viewto
- The second view