public final class Arguments extends Object
Immutable.
Modifier and Type | Method and Description |
---|---|
static Arguments |
createArguments(List<? extends Node> args)
Returns a new
Arguments which contains the specified values. |
static Arguments |
createArguments(Node... args)
Returns a new
Arguments which contains the specified values. |
boolean |
equals(Object o) |
Node |
firstArg()
Returns the first argument in this
Arguments . |
Node |
getArg(int index)
Returns the
Node at the specified position in this Arguments . |
int |
getArgCount()
Returns the number of elements in this
Arguments . |
int |
hashCode() |
Arguments |
replaceAt(int index,
Node replacement)
Returns a new
Arguments resulting from replacing the existing Node at position index with replacement . |
Node |
secondArg()
Returns the second argument in this
Arguments . |
Arguments |
swap(int index1,
int index2)
Returns a new
Arguments resulting from switching the node located at index index1 with the node located at index index2 . |
Node |
thirdArg()
Returns the third argument in this
Arguments . |
String |
toString() |
public static Arguments createArguments(List<? extends Node> args)
Arguments
which contains the specified values.
Note: Arguments
is immutable - so subsequent changes to args
will not be reflected in the returned Arguments
.
args
- the values to be stored in the Arguments
Arguments
which contains the values specified by args
public static Arguments createArguments(Node... args)
Arguments
which contains the specified values.
Note: Arguments
is immutable - so subsequent changes to args
will not be reflected in the returned Arguments
.
args
- the values to be stored in the Arguments
Arguments
which contains the values specified by args
public Node getArg(int index)
Node
at the specified position in this Arguments
.index
- index of the element to returnNode
at the specified position in this Arguments
ArrayIndexOutOfBoundsException
- if the index is out of range (index < 0 || index >= getArgCount())public Node firstArg()
Arguments
.public Node secondArg()
Arguments
.public Node thirdArg()
Arguments
.public int getArgCount()
Arguments
.Arguments
public Arguments replaceAt(int index, Node replacement)
Arguments
resulting from replacing the existing Node
at position index
with replacement
.index
- the index of the Node
that needs to be replaced.replacement
- the new Node
that needs to be store.Arguments
derived from this Arguments
by replacing the element at position index
with replacement
.public Arguments swap(int index1, int index2)
Arguments
resulting from switching the node located at index index1
with the node located at index index2
.index1
- the index in this Arguments
of the first Node
to be swapped.index2
- the index in this Arguments
of the second Node
to be swapped.Arguments
resulting from switching the node located at index index1
with the node located at index index2
.OakGP Genetic Programming Framework