Class SubsetConfiguration.SubsetIterator
- java.lang.Object
-
- org.apache.commons.configuration2.SubsetConfiguration.SubsetIterator
-
- All Implemented Interfaces:
java.util.Iterator<java.lang.String>
- Enclosing class:
- SubsetConfiguration
private final class SubsetConfiguration.SubsetIterator extends java.lang.Object implements java.util.Iterator<java.lang.String>
A specialized iterator to be returned by thegetKeys()
methods. This implementation wraps an iterator from the parent configuration. The keys returned by this iterator are correspondingly transformed.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Iterator<java.lang.String>
parentIterator
Stores the wrapped iterator.
-
Constructor Summary
Constructors Constructor Description SubsetIterator(java.util.Iterator<java.lang.String> it)
Creates a new instance ofSubsetIterator
and initializes it with the parent iterator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
hasNext()
Checks whether there are more elements.java.lang.String
next()
Returns the next element in the iteration.void
remove()
Removes the current element from the iteration.
-
-
-
Method Detail
-
hasNext
public boolean hasNext()
Checks whether there are more elements. Delegates to the parent iterator.- Specified by:
hasNext
in interfacejava.util.Iterator<java.lang.String>
- Returns:
- a flag whether there are more elements
-
next
public java.lang.String next()
Returns the next element in the iteration. This is the next key from the parent configuration, transformed to correspond to the point of view of this subset configuration.- Specified by:
next
in interfacejava.util.Iterator<java.lang.String>
- Returns:
- the next element
-
remove
public void remove()
Removes the current element from the iteration. Delegates to the parent iterator.- Specified by:
remove
in interfacejava.util.Iterator<java.lang.String>
-
-