V - The type of agent the selection is operating on.public interface VertexSelection<V 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<V,S>> |
aggregate(SerializableSupplier<S> aggregatorFactory)
Runs a custom aggregation over this selection.
|
long |
count()
Counts the number of agents in the selection.
|
VertexSelection<V> |
filter(SerializablePredicate<V> predicate)
Applies a filter to this selection.
|
VertexSelection<V> filter(SerializablePredicate<V> 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 Tlong count()
This is a final operation, and will cause the selection to execute.
<S extends VertexAggregator<V,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.