Package org.opt4j.core
Class IndividualSet
java.lang.Object
org.opt4j.core.IndividualSet
- All Implemented Interfaces:
Iterable<Individual>
,Collection<Individual>
,Set<Individual>
- Direct Known Subclasses:
Archive
,Population
The
IndividualSet
is a Set
of Individual
s. It allows
to add and remove listeners, see IndividualSetListener
.- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
add
(Individual individual) boolean
addAll
(Collection<? extends Individual> c) boolean
addAll
(Individual... c) Add allIndividual
s.void
addListener
(IndividualSetListener listener) Adds a listener.void
clear()
boolean
boolean
containsAll
(Collection<?> c) boolean
isEmpty()
iterator()
boolean
boolean
removeAll
(Collection<?> c) void
removeListener
(IndividualSetListener listener) Removes a listener.boolean
retainAll
(Collection<?> c) int
size()
Object[]
toArray()
<T> T[]
toArray
(T[] a) Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
Methods inherited from interface java.util.Set
equals, hashCode, spliterator
-
Constructor Details
-
IndividualSet
public IndividualSet()
-
-
Method Details
-
add
- Specified by:
add
in interfaceCollection<Individual>
- Specified by:
add
in interfaceSet<Individual>
-
iterator
- Specified by:
iterator
in interfaceCollection<Individual>
- Specified by:
iterator
in interfaceIterable<Individual>
- Specified by:
iterator
in interfaceSet<Individual>
-
size
- Specified by:
size
in interfaceCollection<Individual>
- Specified by:
size
in interfaceSet<Individual>
-
addListener
Adds a listener.- Parameters:
listener
- the added listener- See Also:
-
removeListener
Removes a listener.- Parameters:
listener
- the removed listener- See Also:
-
clear
- Specified by:
clear
in interfaceCollection<Individual>
- Specified by:
clear
in interfaceSet<Individual>
-
addAll
- Specified by:
addAll
in interfaceCollection<Individual>
- Specified by:
addAll
in interfaceSet<Individual>
-
addAll
Add allIndividual
s.- Parameters:
c
- the individuals to be added- Returns:
- true if at least one individual was added
-
contains
- Specified by:
contains
in interfaceCollection<Individual>
- Specified by:
contains
in interfaceSet<Individual>
-
containsAll
- Specified by:
containsAll
in interfaceCollection<Individual>
- Specified by:
containsAll
in interfaceSet<Individual>
-
isEmpty
- Specified by:
isEmpty
in interfaceCollection<Individual>
- Specified by:
isEmpty
in interfaceSet<Individual>
-
remove
- Specified by:
remove
in interfaceCollection<Individual>
- Specified by:
remove
in interfaceSet<Individual>
-
removeAll
- Specified by:
removeAll
in interfaceCollection<Individual>
- Specified by:
removeAll
in interfaceSet<Individual>
-
retainAll
- Specified by:
retainAll
in interfaceCollection<Individual>
- Specified by:
retainAll
in interfaceSet<Individual>
-
toArray
- Specified by:
toArray
in interfaceCollection<Individual>
- Specified by:
toArray
in interfaceSet<Individual>
-
toArray
- Specified by:
toArray
in interfaceCollection<Individual>
- Specified by:
toArray
in interfaceSet<Individual>
-