|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.virtualmock.call.CallQueue
This class represents a sequence of calls. Calls added are stored sequentially, and can be retrieved in same order they were added. Calls can also be retrieved by Signature. Utility methods are also provided to manage the queue.
| Constructor Summary | |
CallQueue()
|
|
| Method Summary | |
void |
add(Call call)
Adds a new call to the end of the queue, and also sets the signatureSequence for the call. |
void |
clear()
Reinitialize by clearing out all calls. |
Call |
getCallByCallId(java.lang.String callId)
Gets a call based on the callId. |
java.util.List |
getCalls()
Get all calls that have been added, in order. |
Call |
getFirstCallWithMatchingSignature(Signature signature)
Gets the first call in the queue which has a signature matching the parameter. |
protected int |
getIndexOfFirstCallWithMatchingSignature(Signature signature)
Gets the index of the first call which has the same signature. |
int |
getIndexOfNextCallWithMatchingSignature(int startIndex,
Signature signature)
Gets the index of the next call in the queue which has a signature matching the parameter, starting at the specified index. |
int |
getMatchingSignatureCount(Signature signature)
Returns the number of calls in the queue with the specified signature. |
Call |
getNextCallWithMatchingSignature(int startIndex,
Signature signature)
Gets the next call in the queue which has a signature matching the parameter, starting at the specified index. |
protected java.util.List |
getSignatures()
Get the signatures for all the calls in the queue, in the same order as the calls. |
boolean |
hasCallWithMatchingSignature(Call call)
Indicates if the queue has a call matching the specified signature. |
boolean |
hasCallWithMatchingSignature(Signature signature)
Indicates if the queue has a call matching the specified signature. |
int |
size()
Get the number of calls in the queue. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public CallQueue()
| Method Detail |
public Call getCallByCallId(java.lang.String callId)
callId - the unique identifier for the call
public java.util.List getCalls()
public Call getFirstCallWithMatchingSignature(Signature signature)
signature - the signature used to look up the call
public int getIndexOfNextCallWithMatchingSignature(int startIndex,
Signature signature)
startIndex - the index to start looking atsignature - the signature used to look up the call
public int getMatchingSignatureCount(Signature signature)
signature - the signature to match
public Call getNextCallWithMatchingSignature(int startIndex,
Signature signature)
startIndex - the index to start looking atsignature - the signature used to look up the call
public void add(Call call)
call - a call to add to the queuepublic void clear()
public boolean hasCallWithMatchingSignature(Signature signature)
signature - the signature to match
public boolean hasCallWithMatchingSignature(Call call)
call - the call to match
public int size()
protected int getIndexOfFirstCallWithMatchingSignature(Signature signature)
signature - The signature to match on
protected java.util.List getSignatures()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||