|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jmock.expectation.ReturnObjectBag
public class ReturnObjectBag
The ReturnObjectBag is a map containing instances of ReturnObjectList. A single instance is held for each mapkey. Every time a call to putObjectToReturn or getNextReturnObject is made an object is added or removed from the ReturnObjectList for the given key. This allows the ReturnObjectBag to be used to return an ordered list of objects for each key regardless of the order in which the key requests are made.
ReturnObjectList
Constructor Summary | |
---|---|
ReturnObjectBag(String name)
|
Method Summary | |
---|---|
Hashtable |
getHashTable()
|
boolean |
getNextReturnBoolean(Object key)
|
int |
getNextReturnInt(Object key)
|
Object |
getNextReturnObject(int key)
Returns the next object in the ReturnObjectList for a given int key. |
Object |
getNextReturnObject(Object key)
Returns the next object in the ReturnObjectList for a given key. |
void |
putObjectToReturn(int key,
Object value)
Places an object into the list of return objects for a particular int key |
void |
putObjectToReturn(Object key,
boolean value)
Places an boolean into the list of return objects for a particular key. |
void |
putObjectToReturn(Object key,
int value)
Places an int into the list of return objects for a particular key. |
void |
putObjectToReturn(Object key,
Object value)
Places an object into the list of return objects for a particular key |
void |
verify()
Checks each the list for each key to verify that all no objects remain in the list for that key. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ReturnObjectBag(String name)
name
- Name used to describe an instance of ReturnObjectBag in error messagesMethod Detail |
---|
public void putObjectToReturn(Object key, Object value)
key
- the key against which the object will be storedvalue
- the value to be added to the list for that keyReturnObjectList.addObjectToReturn(java.lang.Object)
public void putObjectToReturn(int key, Object value)
key
- the key against which the object will be storedvalue
- the value to be added to the list for that keyReturnObjectList.addObjectToReturn(java.lang.Object)
public void putObjectToReturn(Object key, int value)
key
- the key against which the object will be storedvalue
- the value to be added to the list for that keyReturnObjectList.addObjectToReturn(java.lang.Object)
,
getNextReturnInt(java.lang.Object)
public void putObjectToReturn(Object key, boolean value)
key
- the key against which the object will be storedvalue
- the value to be added to the list for that keyReturnObjectList.addObjectToReturn(java.lang.Object)
,
getNextReturnBoolean(java.lang.Object)
public void verify()
verify
in interface Verifiable
ReturnObjectList.verify()
public Object getNextReturnObject(Object key)
key
- The key for which the next object should be returned.
ReturnObjectList.nextReturnObject()
public Object getNextReturnObject(int key)
key
- The key for which the next object should be returned.
ReturnObjectList.nextReturnObject()
public Hashtable getHashTable()
public int getNextReturnInt(Object key)
public boolean getNextReturnBoolean(Object key)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |