public class View extends AbstractList<Address> implements Comparable<View>, Streamable, Iterable<Address>
Modifier and Type | Field and Description |
---|---|
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.
|
modCount
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 view_id,
Address[] members)
Creates a new view.
|
View(ViewId view_id,
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
|
boolean |
containsMembers(Address... mbrs)
Returns true if all mbrs are elements of this view, false otherwise
|
View |
copy()
Deprecated.
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(Object obj) |
Address |
get(int index) |
Address |
getCoord() |
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 the member list
|
Address[] |
getMembersRaw()
Returns the underlying array.
|
ViewId |
getVid()
Deprecated.
|
ViewId |
getViewId()
Returns the view ID of this view
if this view was created with the empty constructur, null will be returned
|
int |
hashCode() |
Iterator<Address> |
iterator() |
static List<Address> |
leftMembers(View one,
View two)
Returns a list of members which left from view one to two
|
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.
|
add, add, addAll, clear, indexOf, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subList
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
forEach, spliterator
addAll, contains, containsAll, isEmpty, remove, removeAll, replaceAll, retainAll, sort, spliterator, toArray, toArray
parallelStream, removeIf, stream
protected ViewId view_id
protected Address[] members
protected static final boolean suppress_view_size
public View()
public View(ViewId view_id, 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 Address getCoord()
public List<Address> getMembers()
public Address[] getMembersRaw()
public boolean containsMember(Address mbr)
mbr
- - the address of the member,public boolean containsMembers(Address... mbrs)
public int compareTo(View o)
compareTo
in interface Comparable<View>
public boolean equals(Object obj)
equals
in interface Collection<Address>
equals
in interface List<Address>
equals
in class AbstractList<Address>
public boolean deepEquals(View other)
public int hashCode()
hashCode
in interface Collection<Address>
hashCode
in interface List<Address>
hashCode
in class AbstractList<Address>
public int size()
size
in interface Collection<Address>
size
in interface List<Address>
size
in class AbstractCollection<Address>
@Deprecated public View copy()
public String toString()
toString
in class AbstractCollection<Address>
public void writeTo(DataOutput out) throws Exception
Streamable
writeTo
in interface Streamable
Exception
public void readFrom(DataInput in) throws Exception
Streamable
readFrom
in interface Streamable
Exception
public int serializedSize()
public static List<Address> leftMembers(View one, View two)
one
- two
- public static Address[][] diff(View from, View to)
from
- The first viewto
- The second viewCopyright © 2018 JBoss, a division of Red Hat. All rights reserved.