01: /*
02: *
03: * Copyright (c) 2002 Adrian Price. All rights reserved.
04: */
05:
06: package org.enhydra.shark.api.client.wfmc.wapi;
07:
08: import java.util.NoSuchElementException;
09:
10: /**
11: * Iterator for retrieving activity instances.
12: *
13: * @author Adrian Price
14: */
15: public class WMActivityInstanceIterator extends WMIterator {
16: private WMActivityInstance[] array;
17:
18: /**
19: * Retrieves the next activity instance.
20: *
21: * @return The activity instance.
22: * @throws WMNoMoreDataException if no more data are available.
23: */
24: WMActivityInstance tsNext() throws WMNoMoreDataException {
25: try {
26: return array[cursor++];
27: } catch (Throwable _) {
28: throw new WMNoMoreDataException();
29: }
30: }
31:
32: public Object next() {
33: try {
34: return tsNext();
35: } catch (WMNoMoreDataException e) {
36: throw new NoSuchElementException(e.getMessage());
37: }
38: }
39:
40: public WMActivityInstance[] getArray() {
41: return array;
42: }
43:
44: public void setArray(WMActivityInstance[] array) {
45: this.array = array;
46: }
47: }
|