-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathProcessList.java
33 lines (28 loc) · 954 Bytes
/
ProcessList.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/**
* filename: ProcessList.java
*
* @author Christopher Sasarak
*/
import java.util.ArrayList;
import java.awt.image.RenderedImage;
import java.util.Iterator;
/**
* @class This class is an ArrayList of ImageProcesses. Processes can be added
* and removed from the list and when this class's process method is called it
* will run all of the Process methods on the objects it contains.
*/
public class ProcessList extends ArrayList<ImageProcess> implements ImageProcess {
/**
* This is the process method defined by ImageProcess. It will
* go through all ImageProcess objects in the list and then run
* their process methods in turn.
*/
public RenderedImage process(RenderedImage img){
Iterator iter = this.iterator();
while(iter.hasNext()){
ImageProcess next = (ImageProcess)iter.next();
img = next.process(img);
}
return img;
}
}