public static class SparseSimilarityGraph.Builder<V> extends Object implements SimilarityGraphBuilder<V,SparseSimilarityGraph<V>>
| Constructor and Description |
|---|
SparseSimilarityGraph.Builder(int edgeCapacity) |
| Modifier and Type | Method and Description |
|---|---|
SparseSimilarityGraph.Builder<V> |
add(SimEdge<V> edge)
Add the
simEdge to the graph. |
SparseSimilarityGraph.Builder<V> |
add(V vertex)
Add the
vertex to the graph |
SimEdge<V> |
add(V vertex1,
V vertex2,
double score)
Create and add an edge from
vertex1 to vertex2 with similarity
equal to score to the graph. |
SparseSimilarityGraph<V> |
build() |
int |
edgeCount()
Return the number of edges currently in the graph
|
boolean |
isReusable()
Returns true if build can be called more than once, false otherwise.
|
public SparseSimilarityGraph.Builder(int edgeCapacity)
public SparseSimilarityGraph.Builder<V> add(V vertex)
SimilarityGraphBuildervertex to the graphadd in interface SimilarityGraphBuilder<V,SparseSimilarityGraph<V>>vertex - the vertex to addpublic SimEdge<V> add(V vertex1, V vertex2, double score)
SimilarityGraphBuildervertex1 to vertex2 with similarity
equal to score to the graph.
If a vertex is not present in the graph the vertex is added to the graph.add in interface SimilarityGraphBuilder<V,SparseSimilarityGraph<V>>vertex1 - the parent vertexvertex2 - the child vertexscore - the similarity of the edgepublic SparseSimilarityGraph.Builder<V> add(SimEdge<V> edge)
SimilarityGraphBuildersimEdge to the graph.add in interface SimilarityGraphBuilder<V,SparseSimilarityGraph<V>>edge - the edge to addpublic SparseSimilarityGraph<V> build()
build in interface SimilarityGraphBuilder<V,SparseSimilarityGraph<V>>public boolean isReusable()
SimilarityGraphBuilderisReusable in interface SimilarityGraphBuilder<V,SparseSimilarityGraph<V>>public int edgeCount()
SimilarityGraphBuilderedgeCount in interface SimilarityGraphBuilder<V,SparseSimilarityGraph<V>>Copyright © 2016. All Rights Reserved.