public class CliParameterConsumer extends Object
CliParameterConsumer
holds the command-line parameters together with the current index. In other words it
is like an Iterator
for the parameters.Modifier and Type | Field and Description |
---|---|
(package private) static CliParameterConsumer |
EMPTY_INSTANCE
An empty instance.
|
private int |
index |
private String[] |
parameters |
Constructor and Description |
---|
CliParameterConsumer(String... parameters)
The constructor.
|
Modifier and Type | Method and Description |
---|---|
String |
getCurrent()
This method gets the current element.
|
String |
getNext() |
boolean |
hasNext() |
String |
toString() |
static final CliParameterConsumer EMPTY_INSTANCE
private final String[] parameters
private int index
public CliParameterConsumer(String... parameters)
parameters
- are the parameters to consume.public boolean hasNext()
true
if element is available
, false
otherwise.Iterator.hasNext()
,
Enumeration.hasMoreElements()
public String getNext()
Iterator.next()
,
Enumeration.nextElement()
public String getCurrent()
getNext()
except that it does NOT step on to the
next element.null
if no next
is available.Copyright © 2001–2016 mmm-Team. All rights reserved.