Package oracle.pgx.algorithm
Interface EdgeSet
-
public interface EdgeSet
An unordered set of edges (no duplicates).
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description void
add(PgxEdge e)
Add the edge to the set.boolean
allMatch(java.util.function.Predicate<PgxEdge> predicate)
Check if the predicate holds for all edges in the set.boolean
anyMatch(java.util.function.Predicate<PgxEdge> predicate)
Check if the predicate holds for any edge in the set.void
clear()
Remove all edges from the set.default EdgeSet
clone()
Clone this edge set.boolean
contains(PgxEdge e)
Check if the set contains the given edge.static EdgeSet
create()
Instantiate a new edge set.EdgeSet
filter(java.util.function.Predicate<PgxEdge> predicate)
Filter the edges in the set by the given predicate.EdgeSet
filter(EdgeProperty<java.lang.Boolean> property)
Filter the edges in the set by the given boolean property.void
forEach(java.util.function.Consumer<PgxEdge> callable)
Run the callable for each edge in the set in parallel.void
forSequential(java.util.function.Consumer<PgxEdge> callable)
Run the callable for each edge in the set in sequence.<T extends java.lang.Number>
Tmax(java.util.function.Function<PgxEdge,T> reducer)
Apply the reducer to each edge in the set and compute the maximum.EdgeSet
orderBy(java.util.function.Function<PgxEdge,java.lang.Number> transform, Order order)
Order the edges in the set based on the result of the transformation function.EdgeSet
orderBy(EdgeProperty vertexProperty, Order order)
Order the edges based on the value of the property.void
remove(PgxEdge e)
Remove the edge from the set.int
size()
Get the number of edges in the set.<T extends java.lang.Number>
Tsum(java.util.function.Function<PgxEdge,T> reducer)
Apply the reducer to each edge in the set and sum the results.<T extends java.lang.Number>
Tsum(EdgeProperty<T> reducer)
Get the property for each edge in the set and sum the results.
-
-
-
Method Detail
-
create
static EdgeSet create()
Instantiate a new edge set.- Returns:
-
orderBy
EdgeSet orderBy(EdgeProperty vertexProperty, Order order)
Order the edges based on the value of the property.- Parameters:
vertexProperty
-order
-- Returns:
-
orderBy
EdgeSet orderBy(java.util.function.Function<PgxEdge,java.lang.Number> transform, Order order)
Order the edges in the set based on the result of the transformation function.- Parameters:
transform
-order
-- Returns:
-
filter
EdgeSet filter(java.util.function.Predicate<PgxEdge> predicate)
Filter the edges in the set by the given predicate.- Parameters:
predicate
-- Returns:
-
filter
EdgeSet filter(EdgeProperty<java.lang.Boolean> property)
Filter the edges in the set by the given boolean property.- Parameters:
property
-- Returns:
-
forEach
void forEach(java.util.function.Consumer<PgxEdge> callable)
Run the callable for each edge in the set in parallel.- Parameters:
callable
-
-
forSequential
void forSequential(java.util.function.Consumer<PgxEdge> callable)
Run the callable for each edge in the set in sequence.- Parameters:
callable
-
-
add
void add(PgxEdge e)
Add the edge to the set.- Parameters:
e
-
-
contains
boolean contains(PgxEdge e)
Check if the set contains the given edge.- Parameters:
e
-- Returns:
-
remove
void remove(PgxEdge e)
Remove the edge from the set.- Parameters:
e
-
-
size
int size()
Get the number of edges in the set.- Returns:
-
sum
<T extends java.lang.Number> T sum(java.util.function.Function<PgxEdge,T> reducer)
Apply the reducer to each edge in the set and sum the results.- Type Parameters:
T
-- Parameters:
reducer
-- Returns:
-
sum
<T extends java.lang.Number> T sum(EdgeProperty<T> reducer)
Get the property for each edge in the set and sum the results.- Type Parameters:
T
-- Parameters:
reducer
-- Returns:
-
max
<T extends java.lang.Number> T max(java.util.function.Function<PgxEdge,T> reducer)
Apply the reducer to each edge in the set and compute the maximum.- Type Parameters:
T
-- Parameters:
reducer
-- Returns:
-
anyMatch
boolean anyMatch(java.util.function.Predicate<PgxEdge> predicate)
Check if the predicate holds for any edge in the set.- Parameters:
predicate
-- Returns:
-
allMatch
boolean allMatch(java.util.function.Predicate<PgxEdge> predicate)
Check if the predicate holds for all edges in the set.- Parameters:
predicate
-- Returns:
-
clear
void clear()
Remove all edges from the set.
-
clone
default EdgeSet clone()
Clone this edge set.- Returns:
-
-