Package org.jgroups.util
Class RspList<T>
- java.lang.Object
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
,java.lang.Iterable<Rsp<T>>
,java.util.Map<Address,Rsp<T>>
public class RspList<T> extends java.util.HashMap<Address,Rsp<T>> implements java.lang.Iterable<Rsp<T>>
Contains responses from all members. Marks faulty members. A RspList is a response list used in peer-to-peer protocols. This class is unsynchronized- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RspList<T>
addRsp(Address sender, T retval)
T
getFirst()
Returns the first value in the response set.java.util.List<T>
getResults()
Returns the results from non-suspected members that are not null.java.util.List<Address>
getSuspectedMembers()
T
getValue(java.lang.Object key)
Returns the value associated with address keyboolean
isReceived(Address sender)
boolean
isSuspected(Address sender)
java.util.Iterator<Rsp<T>>
iterator()
int
numReceived()
int
numSuspectedMembers()
java.lang.String
toString()
-
Methods inherited from class java.util.HashMap
clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
-
-
-
-
Method Detail
-
getValue
public T getValue(java.lang.Object key)
Returns the value associated with address key- Parameters:
key
-- Returns:
- Object value
-
isReceived
public boolean isReceived(Address sender)
-
numSuspectedMembers
public int numSuspectedMembers()
-
numReceived
public int numReceived()
-
getFirst
public T getFirst()
Returns the first value in the response set. This is random, but we try to return a non-null value first
-
getResults
public java.util.List<T> getResults()
Returns the results from non-suspected members that are not null.
-
getSuspectedMembers
public java.util.List<Address> getSuspectedMembers()
-
isSuspected
public boolean isSuspected(Address sender)
-
toString
public java.lang.String toString()
-
-