package com.algomagic.atn; import java.util.*; public class BatchUpdate { private List _updates; public BatchUpdate( List updates ) { _updates = updates; } public BatchUpdate( ) { _updates = new ArrayList( ); } public void addElementAttribute( ElementAttribute e ) { _updates.add( e ); } public boolean isEmpty( ) { return _updates.isEmpty( ); } public void apply( ) { for( Iterator i = _updates.iterator( ); i.hasNext( ); ) { ElementAttribute e = (ElementAttribute)i.next( ); e.apply( ); } } public void undo( ) { for( Iterator i = _updates.iterator( ); i.hasNext( ); ) { ElementAttribute e = (ElementAttribute)i.next( ); e.undo( ); } } }