th.co.edge.jseq
Class MockObjectMap

java.lang.Object
  extended by th.co.edge.jseq.MockObjectMap

public class MockObjectMap
extends java.lang.Object

A MockObjectMap is a mapping from names to MockObjects, with utility methods to make it easy to translate from Activations to MockObjects, with automatic handling of column numbers.


Constructor Summary
MockObjectMap()
           
 
Method Summary
 void add(MockObjectMap otherObjectMap)
          Ensures that all MockObjects in another MockObjectMap is also in this map.
static MockObjectMap addAll(Activation activation)
          Returns a new MockObjectMap where the method calls represented by the given Activation and its nested activations have been added as MockObjects to this map, with the activation method call first, and the nested method calls in the order they were added to the activation.
 MockObject get(java.lang.String name)
          Returns the MockObject associated with the given name, or null if there is none.
 java.util.List<MockObject> listView()
          Returns a list of all MockObjects in this map, ordered by column number (and name if the same column number occurs several times, which it normally should not do).
 java.lang.String toString()
          Returns a string representation of this MockObjectMap, mainly useful for logging.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MockObjectMap

public MockObjectMap()
Method Detail

add

public void add(MockObjectMap otherObjectMap)
Ensures that all MockObjects in another MockObjectMap is also in this map.

Parameters:
otherObjectMap - the MockObjectMap whose MockObjects to add to this map if necessary

addAll

public static MockObjectMap addAll(Activation activation)
Returns a new MockObjectMap where the method calls represented by the given Activation and its nested activations have been added as MockObjects to this map, with the activation method call first, and the nested method calls in the order they were added to the activation.

Parameters:
activation - the Activation whose method call and nested method calls to add to this map
Returns:
a new MockObjectMap containing all method calls from activation

get

public MockObject get(java.lang.String name)
Returns the MockObject associated with the given name, or null if there is none.

Parameters:
name - the name of the MockObject to look up
Returns:
the MockObject associated with name, or null if there is none

listView

public java.util.List<MockObject> listView()
Returns a list of all MockObjects in this map, ordered by column number (and name if the same column number occurs several times, which it normally should not do).

Returns:
a list of all MockObjects in this map

toString

public java.lang.String toString()
Returns a string representation of this MockObjectMap, mainly useful for logging.

Overrides:
toString in class java.lang.Object
Returns:
a string representation of this MockObjectMap


Copyright © 2008 Edge Software, Co., Ltd.. All Rights Reserved.