T
- The type of agent the selection is operating on.public interface VertexSelection<T extends Vertex>
Graph
. Selections are created via the Graph.selectVertices(Class)
method.
Selections are lazy, and so are only executed when a final operation is applied, such as
count()
.
Modifier and Type | Method and Description |
---|---|
<S extends VertexAggregator<T,S>> |
aggregate(SerializableSupplier<S> aggregatorFactory)
Runs a custom aggregation over this selection.
|
long |
count()
Counts the number of agents in the selection.
|
VertexSelection<T> |
filter(SerializablePredicate<T> predicate)
Applies a filter to this selection.
|
VertexSelection<T> filter(SerializablePredicate<T> predicate)
SerializablePredicate
predicate will
be run on each agent, and its return value will determine if the agent remains in the selection
or not.predicate
- Predicate on agents of type long count()
This is a final operation, and will cause the selection to execute.
<S extends VertexAggregator<T,S>> S aggregate(SerializableSupplier<S> aggregatorFactory)
VertexAggregator
implementations, as multiple aggregator instances will be created on demand,
as this is executed in parallel.S
- The VertexAggregator
implementation class type.aggregatorFactory
- A Supplier
of VertexAggregator
implementation
instances.VertexAggregator
instance.