Package com.jgalgo.graph
Interface IEdgeIter
-
- All Superinterfaces:
EdgeIter<Integer,Integer>
,IntIterator
,Iterator<Integer>
,PrimitiveIterator<Integer,IntConsumer>
,PrimitiveIterator.OfInt
public interface IEdgeIter extends EdgeIter<Integer,Integer>, IntIterator
Iterator used to iterate over int graph edges.This interface is a specific version of
EdgeIter
forIntGraph
.Each
int
returned byIntIterator.nextInt()
is an ID of an edge iterated by the iterator. The source and target of the last iterated edge are available bysourceInt()
andtargetInt()
.IntGraph g = ...; int vertex = ...; for (IEdgeIter eit = g.outEdges(vertex).iterator(); eit.hasNext();) { int e = eit.nextInt(); int u = eit.sourceInt(); int v = eit.targetInt(); assert vertex == u; System.out.println("Out edge of " + vertex + ": " + e + "(" + u + ", " + v + ")"); }
- Author:
- Barak Ugav
- See Also:
IEdgeSet
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface java.util.PrimitiveIterator
PrimitiveIterator.OfDouble, PrimitiveIterator.OfInt, PrimitiveIterator.OfLong
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description default Integer
peekNext()
Deprecated.Please usepeekNextInt()
instead to avoid un/boxing.int
peekNextInt()
Peek at the next edge of the iterator without advancing it.default Integer
source()
Deprecated.Please usesourceInt()
instead to avoid un/boxing.int
sourceInt()
Get the source vertex of the last returned edge.default Integer
target()
Deprecated.Please usetargetInt()
instead to avoid un/boxing.int
targetInt()
Get the target vertex of the last returned edge.-
Methods inherited from interface it.unimi.dsi.fastutil.ints.IntIterator
forEachRemaining, forEachRemaining, next, nextInt, skip
-
Methods inherited from interface java.util.PrimitiveIterator.OfInt
forEachRemaining
-
-
-
-
Method Detail
-
peekNextInt
int peekNextInt()
Peek at the next edge of the iterator without advancing it.Similar to
IntIterator.nextInt()
but without advancing the iterator.- Returns:
- the next edge of the iterator
- Throws:
NoSuchElementException
- if there is no 'next' element
-
peekNext
@Deprecated default Integer peekNext()
Deprecated.Please usepeekNextInt()
instead to avoid un/boxing.Peek at the next edge of the iterator without advancing it.Similar to
Iterator.next()
but without advancing the iterator.
-
sourceInt
int sourceInt()
Get the source vertex of the last returned edge.The behavior is undefined if
IntIterator.nextInt()
was not called yet.- Returns:
- the source vertex of the last returned edge
-
source
@Deprecated default Integer source()
Deprecated.Please usesourceInt()
instead to avoid un/boxing.Get the source vertex of the last returned edge.The behavior is undefined if
Iterator.next()
was not called yet.
-
targetInt
int targetInt()
Get the target vertex of the last returned edge.The behavior is undefined if
IntIterator.nextInt()
was not called yet.- Returns:
- the target vertex of the last returned edge
-
target
@Deprecated default Integer target()
Deprecated.Please usetargetInt()
instead to avoid un/boxing.Get the target vertex of the last returned edge.The behavior is undefined if
Iterator.next()
was not called yet.
-
-