private class JavaReduxFileCollection.Walker extends java.lang.Object implements FileCollection.Walker
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
current
The currently open resource. null before the first step and after the last step.
|
private java.net.URL |
currentURL
The URL of the current resource.
|
private java.util.Iterator<java.lang.String> |
iterator
The iterator to wrap, it iterates the resources to open.
|
Modifier | Constructor and Description |
---|---|
private |
Walker(java.util.Iterator<java.lang.String> iterator) |
Modifier and Type | Method and Description |
---|---|
DataLocation |
getCurrentDataLocation()
get a
DataLocation object describing the current file. |
java.lang.String |
getCurrentName()
get the name of the current file in the iteration.
|
java.lang.String |
getType()
return the type of the structure that is iterated.
|
java.io.InputStream |
openCurrent()
create a new InputStream for the current element of the iteration.
|
boolean |
step()
step to next element in the collection if there is another one.
|
private java.util.Iterator<java.lang.String> iterator
private java.lang.String current
private java.net.URL currentURL
public DataLocation getCurrentDataLocation() throws java.util.NoSuchElementException
FileCollection.Walker
DataLocation
object describing the current file.
The dynamic type of the result depends on the implementation in use.getCurrentDataLocation
in interface FileCollection.Walker
DataLocation
, not nulljava.util.NoSuchElementException
- if the previous call to step returned false.public java.lang.String getCurrentName() throws java.util.NoSuchElementException
FileCollection.Walker
getCurrentName
in interface FileCollection.Walker
java.util.NoSuchElementException
- if the previous call to step returned false.public java.lang.String getType()
FileCollection.Walker
getType
in interface FileCollection.Walker
public java.io.InputStream openCurrent() throws java.io.IOException, java.util.NoSuchElementException
FileCollection.Walker
openCurrent
in interface FileCollection.Walker
java.io.IOException
- if the resource cannot be openedjava.util.NoSuchElementException
- if the previous call to step returned false.public boolean step()
FileCollection.Walker
step
in interface FileCollection.Walker