|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.mitre.sim.api3.exec.reference.ReferencePopulation
Reference implementation of the Population
interface.
Copyright © 2003-2004 The MITRE Corporation
Nested Class Summary | |
class |
ReferencePopulation.TriggerBecomesEmpty
|
class |
ReferencePopulation.TriggerExcludes
|
class |
ReferencePopulation.TriggerIncludes
|
class |
ReferencePopulation.TriggerSizeBelow
|
class |
ReferencePopulation.TriggerSizeExceeds
|
Method Summary | |
Population |
applyFilter(Filter filter)
Create new filtered Population . |
Trigger |
becomesEmpty()
Trigger for Population being empty. |
boolean |
contains(Entity e)
Returns true if this |
Trigger |
excludes(Entity entity)
Trigger when Entity not a member. |
Trigger |
includes(Entity entity)
Trigger when Entity is a member. |
boolean |
isEmpty()
Returns true if this Population contains no members. |
java.util.Iterator |
iterator()
Returns an iterator over the members in this Population . |
Population |
join(Population pop)
Create new combination Population . |
Population |
rejectFilter(Filter filter)
Create new filtered Population . |
int |
size()
Returns the number of members in this Population . |
Trigger |
sizeBelow(int threshold)
Trigger on Population size. |
Trigger |
sizeExceeds(int threshold)
Trigger on Population size. |
Entity[] |
toArray()
Returns an array containing all the members in this Population . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public Population applyFilter(Filter filter)
Population
Population
.
Create new Population
instance whose members are all the members of
the current instance for which the filter
returns true
.
applyFilter
in interface Population
filter
- Developer-supplied instance of Filter
implementation
Population
public Trigger becomesEmpty()
Population
Trigger
for Population
being empty.
Create Trigger
whose
condition
returns true
when the size of the current Population
is zero.
becomesEmpty
in interface Population
Trigger
public boolean contains(Entity e)
Population
true
if this true
if and only if this elt
such that elt.equals(e)
.
(Note that Entity
does not override equals()
.)
contains
in interface Population
e
- Entity
whose membership is to be tested
true
if e
is member of current instancepublic Trigger excludes(Entity entity)
Population
Trigger
when Entity
not a member.
Create Trigger
whose
condition
returns true
when entity
is not a member of the current Population
.
excludes
in interface Population
entity
- Entity
to be excluded
Trigger
public Trigger includes(Entity entity)
Population
Trigger
when Entity
is a member.
Create Trigger
whose
condition
returns true
when entity
is a member of the current Population
.
includes
in interface Population
entity
- Entity
to be included
Trigger
public boolean isEmpty()
Population
true
if this Population
contains no members.
isEmpty
in interface Population
true
if this Population
contains no memberspublic java.util.Iterator iterator()
Population
Population
.
There are no guarantees concerning the order in which the members are returned.
The behavior of the iterator is undefined if the Entity takes any action while
holding an Iterator
returned by this method that might change
the membership of the Population
.
iterator
in interface Population
Iterator
over the members of this Population
public Population join(Population pop)
Population
Population
.
Create new Population
instance whose members are all the members of
the current instance and all the members of pop
.
Like all instances of Population
, the new instance contains no
duplicates.
join
in interface Population
Population
public Population rejectFilter(Filter filter)
Population
Population
.
Create new Population
instance whose members are all the members of
the current instance for which the filter
returns false
.
rejectFilter
in interface Population
filter
- Developer-supplied instance of Filter
implementation
Population
public int size()
Population
Population
.
If this Population
contains more than Integer.MAX_VALUE
members,
returns Integer.MAX_VALUE
.
size
in interface Population
Population
public Trigger sizeBelow(int threshold)
Population
Trigger
on Population
size.
Create Trigger
whose
condition
returns true
when the size of the current Population
is less than threshold
.
sizeBelow
in interface Population
threshold
- size below which Trigger
is true
Trigger
public Trigger sizeExceeds(int threshold)
Population
Trigger
on Population
size.
Create Trigger
whose
condition
returns true
when the size of the current Population
is greater than threshold
.
sizeExceeds
in interface Population
threshold
- size above which Trigger
is true
Trigger
public Entity[] toArray()
Population
Population
.
There are no guarantees as to the order of the array elements.
The caller is free to modify the returned array.
If the membership of the Population
changes after this call returns,
the array is not modified.
Thus the array is a snapshot of the membership at the time of the call.
toArray
in interface Population
Population
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |