public abstract class BoundedArchive extends AbstractArchive
Archive with bounded size.| Constructor and Description |
|---|
BoundedArchive(int capacity)
Constructs a bounded archive with the specified capacity.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
addCheckedIndividual(Individual individual)
Adds the
Individual to this Archive without further
checks. |
boolean |
addCheckedIndividuals(Collection<? extends Individual> c)
Adds the
Individuals to this Archive without further
checks. |
int |
getCapacity()
Returns the capacity of this
BoundedArchive. |
void |
setCapacity(int capacity)
Sets the capacity of this
BoundedArchive. |
updateaddListener, clear, contains, containsAll, isEmpty, iterator, remove, removeAll, removeListener, retainAll, size, toArray, toArrayequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitequals, hashCode, spliteratorparallelStream, removeIf, stream@Inject public BoundedArchive(int capacity)
capacity - Capacity of this archivepublic void setCapacity(int capacity)
BoundedArchive.capacity - new capacity of this bounded archivegetCapacity()public int getCapacity()
BoundedArchive.setCapacity(int)public boolean addCheckedIndividual(Individual individual)
ArchiveIndividual to this Archive without further
checks. Must be used only if the Individual is checked to be
Pareto-dominant and, according to possible archive size restrictions, can
be added to this Archive.individual - the individual to be actually added to the archiveIndexOutOfBoundsException - if the capacity is reached.public boolean addCheckedIndividuals(Collection<? extends Individual> c)
ArchiveIndividuals to this Archive without further
checks. Must be used only if the Individuals are checked to be
Pareto-dominant and, according to possible archive size restrictions, can
all be added to this Archive.c - the individuals to be actually added to the archiveIndexOutOfBoundsException - if the capacity is reached.