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