org.jfree.report.util
Class PropertiesIterator

java.lang.Object
  extended byorg.jfree.report.util.PropertiesIterator
All Implemented Interfaces:
java.util.Iterator

public class PropertiesIterator
extends java.lang.Object
implements java.util.Iterator

The properties iterator iterates over a set of enumerated properties. The properties are named by an optional prefix plus a number, which is counted up on each iteration:

The iterator iterates over all subsequent numbered proprties until the number-sequence is finished.

Author:
Thomas Morgner

Constructor Summary
PropertiesIterator(java.util.Properties properties)
          Creates a new properties iterator without an prefix.
PropertiesIterator(java.util.Properties properties, java.lang.String prefix)
          Creates a new properties iterator with the given prefix.
 
Method Summary
 boolean hasNext()
          Returns true if there is a property in the underlying collection with a name that matches the name returned by the getNextKey() method.
 java.lang.Object next()
          Returns the property with a name the same as the name generated by the getNextKey() method, or null if there is no such property (that is, then end of the sequence has been reached).
 void remove()
          Always throws UnsupportedOperationException as remove is not implemented for this iterator.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PropertiesIterator

public PropertiesIterator(java.util.Properties properties)
Creates a new properties iterator without an prefix.

Parameters:
properties - the underlying properties collection.

PropertiesIterator

public PropertiesIterator(java.util.Properties properties,
                          java.lang.String prefix)
Creates a new properties iterator with the given prefix.

Parameters:
properties - the underlying properties collection.
prefix - a prefix for generating property names (null permitted).
Method Detail

hasNext

public boolean hasNext()
Returns true if there is a property in the underlying collection with a name that matches the name returned by the getNextKey() method.

Specified by:
hasNext in interface java.util.Iterator
Returns:
true if there is another property with a name in the correct form.

next

public java.lang.Object next()
Returns the property with a name the same as the name generated by the getNextKey() method, or null if there is no such property (that is, then end of the sequence has been reached).

Specified by:
next in interface java.util.Iterator
Returns:
the property or null.

remove

public void remove()
Always throws UnsupportedOperationException as remove is not implemented for this iterator.

Specified by:
remove in interface java.util.Iterator
Throws:
java.lang.UnsupportedOperationException - as remove is not supported.