Class DefaultConfigurationKey.KeyIterator
java.lang.Object
org.apache.commons.configuration.tree.DefaultConfigurationKey.KeyIterator
- Enclosing class:
DefaultConfigurationKey
public class DefaultConfigurationKey.KeyIterator
extends Object
implements Iterator<Object>, Cloneable
A specialized iterator class for tokenizing a configuration key. This
class implements the normal iterator interface. In addition it provides
some specific methods for configuration keys.
- Since:
- 1.3
- Version:
- $Id: DefaultConfigurationKey.java 1231724 2012-01-15 18:40:31Z oheger $
- Author:
- Commons Configuration team
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()Creates a clone of this object.Returns the current key of the iteration (without skipping to the next element).currentKey(boolean decorated) Returns the current key of the iteration (without skipping to the next element).intgetIndex()Returns the index value of the current key.booleanhasIndex()Returns a flag if the current key has an associated index.booleanhasNext()Checks if there is a next element.booleanReturns a flag if the current key is an attribute.booleanReturns a flag whether the current key refers to a property (i.e.next()Returns the next object in the iteration.nextKey()Returns the next key part of this configuration key.nextKey(boolean decorated) Returns the next key part of this configuration key.voidremove()Removes the current object in the iteration.Methods inherited from class Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Iterator
forEachRemaining
-
Constructor Details
-
KeyIterator
public KeyIterator()
-
-
Method Details
-
nextKey
-
nextKey
Returns the next key part of this configuration key. The boolean parameter indicates wheter a decorated key should be returned. This affects only attribute keys: if the parameter is false, the attribute markers are stripped from the key; if it is true, they remain.- Parameters:
decorated- a flag if the decorated key is to be returned- Returns:
- the next key part
-
hasNext
-
next
-
remove
-
currentKey
Returns the current key of the iteration (without skipping to the next element). This is the same key the previousnext()call had returned. (Short form ofcurrentKey(false).- Returns:
- the current key
-
currentKey
Returns the current key of the iteration (without skipping to the next element). The boolean parameter indicates wheter a decorated key should be returned. This affects only attribute keys: if the parameter is false, the attribute markers are stripped from the key; if it is true, they remain.- Parameters:
decorated- a flag if the decorated key is to be returned- Returns:
- the current key
-
isAttribute
Returns a flag if the current key is an attribute. This method can be called afternext().- Returns:
- a flag if the current key is an attribute
-
isPropertyKey
Returns a flag whether the current key refers to a property (i.e. is no special attribute key). Usually this method will return the opposite ofisAttribute(), but if the delimiters for normal properties and attributes are set to the same string, it is possible that both methods return true.- Returns:
- a flag if the current key is a property key
- See Also:
-
getIndex
Returns the index value of the current key. If the current key does not have an index, return value is -1. This method can be called afternext().- Returns:
- the index value of the current key
-
hasIndex
Returns a flag if the current key has an associated index. This method can be called afternext().- Returns:
- a flag if the current key has an index
-
clone
-