Interface IdBuilderInt
-
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface IdBuilderInt extends IdBuilder<Integer>
Builder for unique identifiers of vertices or edges in anIntGraph.An
IntGraphallows adding vertices by either providing an identifier (IntGraph.addVertex(int)) or without (IntGraph.addVertexInt()). If no identifier is provided, the graph will generate one using an instance of this interface. The same is true for edges, seeIntGraph.addEdge(int, int, int)andIntGraph.addEdge(int, int). The graph expose its vertex and edge builders usingIntGraph.vertexBuilder()andIntGraph.edgeBuilder(), which may returnnull. The identifiers returned by this interface must be unique in the graph.This interface is shared for both vertices and edges, but an instance of this interface is used only for one of them at a time.
This interface is a specific version of
IdBuilderforIntGraph.- Author:
- Barak Ugav
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description intbuild(IntSet existing)Builds a unique identifier for a vertex or an edge.default Integerbuild(Set<Integer> existing)Deprecated.usebuild(IntSet)instead to avoid unnecessary un/boxingstatic IdBuilderIntdefaultBuilder()Get an default builder forintidentifiers.static Supplier<IdBuilderInt>defaultFactory()Get an default factory forintidentifiers.
-
-
-
Method Detail
-
build
@Deprecated default Integer build(Set<Integer> existing)
Deprecated.usebuild(IntSet)instead to avoid unnecessary un/boxingBuilds a unique identifier for a vertex or an edge.
-
build
int build(IntSet existing)
Builds a unique identifier for a vertex or an edge.- Parameters:
existing- the identifiers of the vertices or edges already in the graph- Returns:
- a unique identifier
-
defaultBuilder
static IdBuilderInt defaultBuilder()
Get an default builder forintidentifiers.The returned factory may be passed to
GraphFactory.setVertexBuilder(IdBuilder).- Returns:
- a default builder for
intidentifiers
-
defaultFactory
static Supplier<IdBuilderInt> defaultFactory()
Get an default factory forintidentifiers.The returned factory may be passed to
GraphFactory.setVertexFactory(Supplier).- Returns:
- a default factory for
intidentifiers
-
-