public class Parameters
extends java.util.ArrayList<java.lang.String>
Modifier and Type | Field and Description |
---|---|
protected static int |
indexExtendedArg
Extended argument index.
|
protected static java.lang.String |
name
Configuration file name.
|
protected java.util.ArrayList<java.lang.String> |
names
Names of the parameteres.
|
static java.lang.String |
PERC_SIZE_TXT
Text flag (size).
|
static java.lang.String |
SEED_TXT
Text flag (Seed).
|
protected static java.lang.String |
use
Contains the message of correct use to the user of the program.
|
Constructor and Description |
---|
Parameters(java.util.ArrayList<java.lang.String> args)
Constructor.
|
Parameters(int _size)
Constructor.
|
Parameters(java.lang.String[] args)
Constructor.
|
Parameters(java.lang.String[] names,
java.lang.String[] args)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
static void |
assertBasicArgs(java.lang.String[] args)
Assert the program arguments
|
static java.lang.String |
assertExtendedArg(java.lang.String[] args,
int pos,
java.lang.String name,
double llim,
double rlim)
Assert the program arguments which depends on the specific algorithm.
|
static java.lang.String |
assertExtendedArg(java.lang.String[] args,
java.lang.String name,
double llim,
double rlim)
Assert the program arguments which depends on the specific algorithm.
|
static double |
assertExtendedArgAsDouble(java.lang.String[] args,
int pos,
java.lang.String name,
double llim,
double rlim)
Assert a double arguments which depends on the specific algorithm.
|
static double |
assertExtendedArgAsDouble(java.lang.String[] args,
java.lang.String name,
double llim,
double rlim)
Assert a double arguments which depends on the specific algorithm.
|
static int |
assertExtendedArgAsInt(java.lang.String[] args,
int pos,
java.lang.String name,
double llim,
double rlim)
Assert an integer argument which depends on the specific algorithm.
|
static int |
assertExtendedArgAsInt(java.lang.String[] args,
java.lang.String name,
double llim,
double rlim)
Assert an integer argument which depends on the specific algorithm.
|
static java.lang.String |
assertExtendedArgAsString(java.lang.String[] args,
int pos,
java.lang.String name,
java.util.ArrayList<java.lang.String> values)
Assert the program arguments which depends on the specific algorithm.
|
static java.lang.String |
assertExtendedArgAsString(java.lang.String[] args,
int pos,
java.lang.String name,
java.lang.String[] values)
Assert the program arguments which depends on the specific algorithm.
|
boolean |
existMore()
Informs if there are more arguments.
|
double |
getDouble(int index)
Parses the parameter with the index given and returns it as real
|
static java.lang.String |
getFileName()
Returns the file
|
int |
getInt(int index)
Parses the parameter with the index given and returns it as integer
|
java.lang.String |
getName(int index)
Returns and specified name of a parameter.
|
double |
getNextAsDouble()
Return next parameter as double.
|
int |
getNextAsInt()
Return next parameter as int.
|
java.lang.String |
getNextAsString()
Return next parameter as string.
|
java.lang.String[] |
getNextAsStringArray()
Return next parameter as string.
|
java.lang.String[] |
getRemainingParameters()
Returns the remained not parsed parameters
|
static void |
setUse(java.lang.String algorithmName,
java.lang.String advParams)
Sets the use of the algorithm
|
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, forEach, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
public static final java.lang.String SEED_TXT
public static final java.lang.String PERC_SIZE_TXT
protected java.util.ArrayList<java.lang.String> names
protected static java.lang.String use
protected static java.lang.String name
protected static int indexExtendedArg
public Parameters(int _size)
_size
- number of parameterspublic Parameters(java.lang.String[] args)
args
- list of not parsed parameterspublic Parameters(java.util.ArrayList<java.lang.String> args)
args
- list of not parsed parameterspublic Parameters(java.lang.String[] names, java.lang.String[] args)
names
- parameters name.args
- list of not parsed parameters.public static java.lang.String getFileName()
public java.lang.String getName(int index)
index
- Parameter in indexth position.public int getInt(int index)
index
- asked parameter index.public double getDouble(int index)
index
- asked parameter index.public int getNextAsInt()
public double getNextAsDouble()
public java.lang.String getNextAsString()
public java.lang.String[] getNextAsStringArray()
public java.lang.String[] getRemainingParameters()
public boolean existMore()
public static void setUse(java.lang.String algorithmName, java.lang.String advParams)
algorithmName
- Human readable name of the implmented algorithmadvParams
- List of parameters of the programpublic static void assertBasicArgs(java.lang.String[] args)
args
- Arguments of the programpublic static java.lang.String assertExtendedArg(java.lang.String[] args, int pos, java.lang.String name, double llim, double rlim)
args
- Arguments of the program.pos
- Position in the array of strings.name
- Name of the argument.llim
- Left value of the interval in which the argument is (only used if the argument is numeric)rlim
- Right value of the interval in which the argument is (only used if the argument is numeric)public static java.lang.String assertExtendedArgAsString(java.lang.String[] args, int pos, java.lang.String name, java.util.ArrayList<java.lang.String> values)
args
- Arguments of the program.pos
- Position in the array of strings.name
- Name of the argument.values
- Posibly values of the parameter.public static java.lang.String assertExtendedArgAsString(java.lang.String[] args, int pos, java.lang.String name, java.lang.String[] values)
args
- Arguments of the program.pos
- Position in the array of strings.name
- Name of the argument.values
- Posibly values of the parameter.public static double assertExtendedArgAsDouble(java.lang.String[] args, int pos, java.lang.String name, double llim, double rlim)
args
- Arguments of the program.pos
- Position in the array of strings.name
- Name of the argument.llim
- Left value of the interval in which the argument is.rlim
- Right value of the interval in which the argument is.public static int assertExtendedArgAsInt(java.lang.String[] args, int pos, java.lang.String name, double llim, double rlim)
args
- Arguments of the program.pos
- Position in the array of strings.name
- Name of the argument.llim
- Left value of the interval in which the argument is.rlim
- Right value of the interval in which the argument is.public static java.lang.String assertExtendedArg(java.lang.String[] args, java.lang.String name, double llim, double rlim)
args
- Arguments of the program.name
- Name of the argument.llim
- Left value of the interval in which the argument is (only used if the argument is numeric)rlim
- Right value of the interval in which the argument is (only used if the argument is numeric)public static double assertExtendedArgAsDouble(java.lang.String[] args, java.lang.String name, double llim, double rlim)
args
- Arguments of the program.name
- Name of the argument.llim
- Left value of the interval in which the argument is.rlim
- Right value of the interval in which the argument is.public static int assertExtendedArgAsInt(java.lang.String[] args, java.lang.String name, double llim, double rlim)
args
- Arguments of the program.name
- Name of the argument.llim
- Left value of the interval in which the argument is.rlim
- Right value of the interval in which the argument is.