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.
IntGraph.
An IntGraph allows 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, see IntGraph.addEdge(int, int, int) and
IntGraph.addEdge(int, int). The graph expose its vertex and edge builders using
IntGraph.vertexBuilder() and IntGraph.edgeBuilder(), which may return null. 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 specification of IdBuilder for IntGraph.
- Author:
- Barak Ugav
-
Method Summary
Modifier and TypeMethodDescriptionintBuilds a unique identifier for a vertex or an edge.default IntegerDeprecated.static IdBuilderIntGet an default builder forintidentifiers.static Supplier<IdBuilderInt> Get an default factory forintidentifiers.
-
Method Details
-
build
Deprecated.usebuild(IntSet)instead to avoid unnecessary un/boxingBuilds a unique identifier for a vertex or an edge. -
build
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
Get an default builder forintidentifiers.The returned factory may be passed to
GraphFactory.setVertexBuilder(IdBuilder).- Returns:
- a default builder for
intidentifiers
-
defaultFactory
Get an default factory forintidentifiers.The returned factory may be passed to
GraphFactory.setVertexFactory(Supplier).- Returns:
- a default factory for
intidentifiers
-
build(IntSet)instead to avoid unnecessary un/boxing