org.jgroups.util
Class RspList

java.lang.Object
  extended by org.jgroups.util.RspList
All Implemented Interfaces:
java.util.Map

public class RspList
extends java.lang.Object
implements java.util.Map

Contains responses from all members. Marks faulty members. A RspList is a response list used in peer-to-peer protocols.


Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
java.util.Map.Entry
 
Constructor Summary
RspList()
           
RspList(java.util.Collection responses)
          Adds a lkist of responses
 
Method Summary
 void addNotReceived(Address sender)
           
 void addRsp(Address sender, java.lang.Object retval)
           
 void addSuspect(Address sender)
           
 void clear()
           
 boolean containsKey(java.lang.Object key)
           
 boolean containsValue(java.lang.Object value)
           
 java.lang.Object elementAt(int i)
          Deprecated. Use entrySet() or values() instead
 java.util.Set entrySet()
           
 java.lang.Object get(java.lang.Object key)
          Returns the Rsp associated with address key
 java.lang.Object getFirst()
          Returns the first value in the response set.
 java.util.Vector getResults()
          Returns the results from non-suspected members that are not null.
 java.util.Vector getSuspectedMembers()
           
 java.lang.Object getValue(java.lang.Object key)
          Returns the value associated with address key
 boolean isEmpty()
           
 boolean isReceived(Address sender)
           
 boolean isSuspected(Address sender)
           
 java.util.Set keySet()
           
 int numSuspectedMembers()
           
 java.lang.Object put(java.lang.Object key, java.lang.Object value)
           
 void putAll(java.util.Map m)
           
 java.lang.Object remove(java.lang.Object key)
           
 void reset()
          Deprecated. Use clear() instead
 int size()
           
 java.lang.String toString()
           
 java.util.Collection values()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Constructor Detail

RspList

public RspList()

RspList

public RspList(java.util.Collection responses)
Adds a lkist of responses

Parameters:
responses - Collection
Method Detail

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface java.util.Map

containsKey

public boolean containsKey(java.lang.Object key)
Specified by:
containsKey in interface java.util.Map

containsValue

public boolean containsValue(java.lang.Object value)
Specified by:
containsValue in interface java.util.Map

get

public java.lang.Object get(java.lang.Object key)
Returns the Rsp associated with address key

Specified by:
get in interface java.util.Map
Parameters:
key - Address (key)
Returns:
Rsp

getValue

public java.lang.Object getValue(java.lang.Object key)
Returns the value associated with address key

Parameters:
key -
Returns:
Object value

put

public java.lang.Object put(java.lang.Object key,
                            java.lang.Object value)
Specified by:
put in interface java.util.Map

remove

public java.lang.Object remove(java.lang.Object key)
Specified by:
remove in interface java.util.Map

putAll

public void putAll(java.util.Map m)
Specified by:
putAll in interface java.util.Map

clear

public void clear()
Specified by:
clear in interface java.util.Map

keySet

public java.util.Set keySet()
Specified by:
keySet in interface java.util.Map

values

public java.util.Collection values()
Specified by:
values in interface java.util.Map

entrySet

public java.util.Set entrySet()
Specified by:
entrySet in interface java.util.Map

reset

public void reset()
Deprecated. Use clear() instead

Clears the response list


addRsp

public void addRsp(Address sender,
                   java.lang.Object retval)

addNotReceived

public void addNotReceived(Address sender)

addSuspect

public void addSuspect(Address sender)

isReceived

public boolean isReceived(Address sender)

numSuspectedMembers

public int numSuspectedMembers()

getFirst

public java.lang.Object 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.Vector getResults()
Returns the results from non-suspected members that are not null.


getSuspectedMembers

public java.util.Vector getSuspectedMembers()

isSuspected

public boolean isSuspected(Address sender)

size

public int size()
Specified by:
size in interface java.util.Map

elementAt

public java.lang.Object elementAt(int i)
                           throws java.lang.ArrayIndexOutOfBoundsException
Deprecated. Use entrySet() or values() instead

Returns the Rsp at index i

Parameters:
i - The index
Returns:
a Rsp
Throws:
java.lang.ArrayIndexOutOfBoundsException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright ? 1998-2006 Bela Ban. All Rights Reserved.