net.sf.mmm.util.cli.base
Class CliParameterConsumer
java.lang.Object
net.sf.mmm.util.cli.base.CliParameterConsumer
public class CliParameterConsumer
- extends Object
A CliParameterConsumer holds the command-line parameters together
with the current index. In other words it is like an
Iterator for the parameters.
- Since:
- 2.0.0
- Author:
- Joerg Hohwiller (hohwille at users.sourceforge.net)
EMPTY_INSTANCE
static final CliParameterConsumer EMPTY_INSTANCE
- An empty instance.
parameters
private final String[] parameters
- See Also:
getNext()
index
private int index
- See Also:
getNext()
CliParameterConsumer
public CliParameterConsumer(String... parameters)
- The constructor.
- Parameters:
parameters - are the parameters to consume.
hasNext
public boolean hasNext()
- Returns:
true if element is available,
false otherwise.- See Also:
Iterator.hasNext(),
Enumeration.hasMoreElements()
getNext
public String getNext()
- Returns:
- the next element.
- See Also:
Iterator.next(),
Enumeration.nextElement()
getCurrent
public String getCurrent()
- This method gets the current element. It is the same as
getNext()
except that it does NOT step on to the next element.
- Returns:
- the current element or
null if no next is available.
toString
public String toString()
-
- Overrides:
toString in class Object
Copyright © 2001-2010 mmm-Team. All Rights Reserved.