protected abstract static class DenseSimilarityGraph.AbstractBuilder<V,G extends SimilarityGraph<V>> extends Object implements SimilarityGraphBuilder<V,G>
| Constructor and Description |
|---|
DenseSimilarityGraph.AbstractBuilder(boolean useIdentityHash) |
| Modifier and Type | Method and Description |
|---|---|
SimilarityGraphBuilder<V,G> |
add(SimEdge<V> simEdge)
Add the
simEdge to the graph. |
SimilarityGraphBuilder<V,G> |
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. |
G |
build() |
protected abstract G |
doBuild(gnu.trove.map.TObjectIntMap<V> vertexIndexMap,
int edgeCount,
SimEdge<V>[][] adjacencyList) |
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 DenseSimilarityGraph.AbstractBuilder(boolean useIdentityHash)
public SimilarityGraphBuilder<V,G> add(V vertex)
SimilarityGraphBuildervertex to the graphadd in interface SimilarityGraphBuilder<V,G extends SimilarityGraph<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,G extends SimilarityGraph<V>>vertex1 - the parent vertexvertex2 - the child vertexscore - the similarity of the edgepublic G build()
build in interface SimilarityGraphBuilder<V,G extends SimilarityGraph<V>>protected abstract G doBuild(gnu.trove.map.TObjectIntMap<V> vertexIndexMap, int edgeCount, SimEdge<V>[][] adjacencyList)
public boolean isReusable()
SimilarityGraphBuilderisReusable in interface SimilarityGraphBuilder<V,G extends SimilarityGraph<V>>public int edgeCount()
SimilarityGraphBuilderedgeCount in interface SimilarityGraphBuilder<V,G extends SimilarityGraph<V>>public SimilarityGraphBuilder<V,G> add(SimEdge<V> simEdge)
SimilarityGraphBuildersimEdge to the graph.add in interface SimilarityGraphBuilder<V,G extends SimilarityGraph<V>>simEdge - the edge to addCopyright © 2016. All Rights Reserved.