Package oracle.pgx.algorithm
Interface VertexSequence
-
public interface VertexSequence
An ordered sequence of vertices which may contain duplicates.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description PgxVertex
back()
Get the vertex at the back of the sequence.void
clear()
Remove all vertices from the sequence.default VertexSequence
clone()
Clone this vertex sequence.boolean
contains(PgxVertex v)
Check if the sequence contains the given vertex.static VertexSequence
create()
Instantiate a new vertex sequence.VertexSet
filter(java.util.function.Predicate<PgxVertex> predicate)
Filter the vertices in the sequence by the given predicate.VertexSet
filter(VertexProperty<java.lang.Boolean> property)
Filter the vertices in the sequence by the given boolean property.void
forEach(java.util.function.Consumer<PgxVertex> callable)
Run the callable for each vertex in the sequence in parallel.void
forSequential(java.util.function.Consumer<PgxVertex> callable)
Run the callable for each vertex in the sequence in sequence.PgxVertex
front()
Get the vertex at the front of the sequence.PgxVertex
pop()
Remove and return a vertex from the sequence.PgxVertex
popBack()
Remove and return the vertex at the back of the sequence.PgxVertex
popFront()
Remove and return the vertex at the front of the sequence.void
push(PgxVertex v)
Add a vertex to the sequence.void
pushBack(PgxVertex v)
Add a vertex to the back of the sequence.void
pushFront(PgxVertex v)
Add a vertex to the front of the sequence.int
size()
Get the number of vertices in the sequence.
-
-
-
Method Detail
-
create
static VertexSequence create()
Instantiate a new vertex sequence.- Returns:
-
filter
VertexSet filter(java.util.function.Predicate<PgxVertex> predicate)
Filter the vertices in the sequence by the given predicate.- Parameters:
predicate
-- Returns:
-
filter
VertexSet filter(VertexProperty<java.lang.Boolean> property)
Filter the vertices in the sequence by the given boolean property.- Parameters:
property
-- Returns:
-
forEach
void forEach(java.util.function.Consumer<PgxVertex> callable)
Run the callable for each vertex in the sequence in parallel.- Parameters:
callable
-
-
forSequential
void forSequential(java.util.function.Consumer<PgxVertex> callable)
Run the callable for each vertex in the sequence in sequence.- Parameters:
callable
-
-
contains
boolean contains(PgxVertex v)
Check if the sequence contains the given vertex.- Parameters:
v
-- Returns:
-
push
void push(PgxVertex v)
Add a vertex to the sequence.- Parameters:
v
-
-
pushFront
void pushFront(PgxVertex v)
Add a vertex to the front of the sequence.- Parameters:
v
-
-
pushBack
void pushBack(PgxVertex v)
Add a vertex to the back of the sequence.- Parameters:
v
-
-
pop
PgxVertex pop()
Remove and return a vertex from the sequence.- Returns:
-
popFront
PgxVertex popFront()
Remove and return the vertex at the front of the sequence.- Returns:
-
popBack
PgxVertex popBack()
Remove and return the vertex at the back of the sequence.- Returns:
-
front
PgxVertex front()
Get the vertex at the front of the sequence.- Returns:
-
back
PgxVertex back()
Get the vertex at the back of the sequence.- Returns:
-
size
int size()
Get the number of vertices in the sequence.- Returns:
-
clear
void clear()
Remove all vertices from the sequence.
-
clone
default VertexSequence clone()
Clone this vertex sequence.- Returns:
-
-