|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.jutil.java.collections.RobustMapVisitor
A robust visitor of maps. The code in visit is performed for each element pair in the visited map.
In addition to the functionality of MapVisitor, RobustMapVisitor allows the
visit
method to throw an exception. It also has support for undoing the changes
done before the exception occurred.
See RobustVisitor for more
information.
Field Summary | |
static java.lang.String |
CVS_REVISION
|
Constructor Summary | |
RobustMapVisitor()
|
Method Summary | |
java.util.Map |
applyTo(java.util.Map map)
public behavior pre (\forall Map.Entry entry; map.entrySet().contains(entry); isValidPair(entry.getKey(), entry.getValue())); // The changes are applied to the given set and it is returned afterwards. post \result == map; post (* public void visit(Object) is called for all elements of |
abstract void |
unvisit(java.lang.Object key,
java.lang.Object value,
java.lang.Object unvisitData)
public behavior pre isValidPair(key, value); // unvisitData is the data returned by the visit method. pre unvisitData == visit(key,value); post (* the changes on This method will be called when the visit method has raised an exception for some key,value pair which was visited after |
abstract java.lang.Object |
visit(java.lang.Object key,
java.lang.Object value)
public behavior pre isValidPair(key, value); post (* returns Data which enables to undo what visit has done in unvisit. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String CVS_REVISION
Constructor Detail |
public RobustMapVisitor()
Method Detail |
public abstract java.lang.Object visit(java.lang.Object key, java.lang.Object value) throws java.lang.Exception
key
- The key of the element pair the code should be applied to.element
- The value of the element pair the code should be applied to.public abstract void unvisit(java.lang.Object key, java.lang.Object value, java.lang.Object unvisitData)
public final java.util.Map applyTo(java.util.Map map) throws java.lang.Exception, java.util.ConcurrentModificationException
public void visit(Object)
is called for all elements of
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |