public final class RankedCandidates extends Object implements Iterable<RankedCandidate>
RankedCandidate
objects.Constructor and Description |
---|
RankedCandidates(RankedCandidate[] candidates)
Constructs a new collection of candidates sorted by their natural ordering.
|
RankedCandidates(RankedCandidate[] candidates,
Comparator<RankedCandidate> comparator)
Constructs a new collection of candidates sorted according to the given comparator.
|
Modifier and Type | Method and Description |
---|---|
RankedCandidate |
best()
Returns the best candidate in this collection.
|
RankedCandidate |
get(int index)
Returns the candidate at the specified position in this collection.
|
Iterator<RankedCandidate> |
iterator() |
int |
size()
Returns the number of candidates in this collection.
|
Stream<RankedCandidate> |
stream()
Returns a sequential
Stream with this collection as its source. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public RankedCandidates(RankedCandidate[] candidates)
public RankedCandidates(RankedCandidate[] candidates, Comparator<RankedCandidate> comparator)
public RankedCandidate get(int index)
index
- index of the candidate to returnArrayIndexOutOfBoundsException
- if the index is out of range (index < 0 || index >= size())public RankedCandidate best()
public int size()
public Stream<RankedCandidate> stream()
Stream
with this collection as its source.public Iterator<RankedCandidate> iterator()
iterator
in interface Iterable<RankedCandidate>
OakGP Genetic Programming Framework