summaryrefslogtreecommitdiff
path: root/Tools/Source/MigrationTools/org/tianocore/migration/PathIterator.java
blob: 0207577ba36f73a23e25bdf1ff18c401439ad9c8 (plain)
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
package org.tianocore.migration;

import java.util.*;

public final class PathIterator implements Common.ForDoAll {
//	 this PathIterator is based on HashSet, an thread implementation is required.
	PathIterator(String path, int md) throws Exception {
		startpath = path;
		mode = md;
		Common.toDoAll(startpath, this, mode);
		it = pathlist.iterator();
	}
	private String startpath = null;
	private int mode;
	private HashSet<String> pathlist = new HashSet<String>();
	private Iterator<String> it = null;

	public final void toDo(String path) throws Exception {
		pathlist.add(path);
	}

	public final String next() {
		return it.next();
	}

	public final boolean hasNext() {
		return it.hasNext();
	}

	public final String toString() {
		return pathlist.toString();
	}
}