axis_examplecompt_changesinfo-opsversion-1.30version-2.00version-3.01version-3.02
Last change
on this file since bd3e314 was
8780cbec,
checked in by Jay Jacobs <Jay.Jacobs@…>, 15 years ago
|
ABAC sources from Cobham
|
-
Property mode set to
100644
|
File size:
914 bytes
|
Rev | Line | |
---|
[8780cbec] | 1 | package com.algomagic.atn; |
---|
| 2 | |
---|
| 3 | import java.util.*; |
---|
| 4 | |
---|
| 5 | public class BatchGraphUpdate { |
---|
| 6 | |
---|
| 7 | private List _updates; |
---|
| 8 | |
---|
| 9 | public BatchGraphUpdate( List updates ) { |
---|
| 10 | _updates = updates; |
---|
| 11 | } |
---|
| 12 | |
---|
| 13 | public BatchGraphUpdate( ) { |
---|
| 14 | _updates = new ArrayList( ); |
---|
| 15 | } |
---|
| 16 | |
---|
| 17 | public void add( ElementAttribute e ) { |
---|
| 18 | _updates.add( e ); |
---|
| 19 | } |
---|
| 20 | |
---|
| 21 | public boolean isEmpty( ) { |
---|
| 22 | return _updates.isEmpty( ); |
---|
| 23 | } |
---|
| 24 | |
---|
| 25 | |
---|
| 26 | public void apply( ) { |
---|
| 27 | for( Iterator i = _updates.iterator( ); i.hasNext( ); ) { |
---|
| 28 | ElementAttribute e = (ElementAttribute)i.next( ); |
---|
| 29 | // System.out.println( e ); |
---|
| 30 | |
---|
| 31 | e.apply( ); |
---|
| 32 | } |
---|
| 33 | |
---|
| 34 | // System.out.println( ); |
---|
| 35 | // System.out.println( ); |
---|
| 36 | |
---|
| 37 | |
---|
| 38 | } |
---|
| 39 | |
---|
| 40 | |
---|
| 41 | public void undo( ) { |
---|
| 42 | for( int i = _updates.size( )-1; i>=0; i-- ) { |
---|
| 43 | ElementAttribute e = (ElementAttribute)_updates.get(i); |
---|
| 44 | // System.out.println( e ); |
---|
| 45 | |
---|
| 46 | e.undo( ); |
---|
| 47 | } |
---|
| 48 | |
---|
| 49 | // System.out.println( ); |
---|
| 50 | // System.out.println( ); |
---|
| 51 | |
---|
| 52 | } |
---|
| 53 | |
---|
| 54 | |
---|
| 55 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.