]> git.proxmox.com Git - mirror_edk2.git/blob - Tools/Source/MigrationTools/org/tianocore/migration/PathIterator.java
first step for MsaOwner in ModuleInfo
[mirror_edk2.git] / Tools / Source / MigrationTools / org / tianocore / migration / PathIterator.java
1 /** @file
2
3 Copyright (c) 2006, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
8
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11
12 **/
13 package org.tianocore.migration;
14
15 import java.io.File;
16 import java.util.*;
17
18 public final class PathIterator implements Common.ForDoAll {
19 // this PathIterator is based on HashSet, an thread implementation is required.
20 PathIterator(String path, int md) throws Exception {
21 startpath = path;
22 mode = md;
23 Common.toDoAll(startpath, this, mode);
24 it = pathlist.iterator();
25 }
26 private String startpath = null;
27 private int mode;
28 private HashSet<String> pathlist = new HashSet<String>();
29 private Iterator<String> it = null;
30
31 public final void run(String path) throws Exception {
32 pathlist.add(path);
33 }
34
35 public boolean filter(File dir) {
36 return true;
37 }
38
39 public final String next() {
40 return it.next();
41 }
42
43 public final boolean hasNext() {
44 return it.hasNext();
45 }
46
47 public final String toString() {
48 return pathlist.toString();
49 }
50 }