Package org.graph4j.util
Class VertexQueue
java.lang.Object
org.graph4j.util.VertexCollection
org.graph4j.util.VertexQueue
A queue of vertices of a graph.
- Author:
- Cristian Frăsinaru
-
Field Summary
Fields inherited from class org.graph4j.util.VertexCollection
bitset, DEFAULT_CAPACITY, first, graph, numVertices, vertices -
Constructor Summary
ConstructorsConstructorDescriptionVertexQueue(Graph graph) VertexQueue(Graph graph, int initialCapacity) VertexQueue(Graph graph, int[] vertices) -
Method Summary
Methods inherited from class org.graph4j.util.VertexCollection
addAll, clear, computeVerticesWeight, contains, equals, getGraph, grow, hashCode, indexOf, indexOf, isClique, isEmpty, isStableSet, iterator, numVertices, remove, removeAll, removeFromPos, removeLast, retainAll, size, toString, union, vertexToString, verticesMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
VertexQueue
-
VertexQueue
-
VertexQueue
-
-
Method Details
-
add
public boolean add(int v) Adds a new element at the end of the queue.- Overrides:
addin classVertexCollection- Parameters:
v- a vertex number.- Returns:
- true, if the collection changed as a result of this call
-
peek
public int peek()Returns the first element in the queue, without removing it.- Returns:
- the first element in the queue.
-
poll
public int poll()Returns and removes the first element in the queue.- Returns:
- the first element in the queue.
-