V
- vertex typeE
- edge typepublic class EdgeIndexFunctionImpl<V extends HasIndex,E> extends java.lang.Object implements EdgeIndexFunction<V,E>
Modifier and Type | Class and Description |
---|---|
private static class |
EdgeIndexFunctionImpl.Pair<T1,T2>
Convenience class
|
Modifier and Type | Field and Description |
---|---|
protected java.util.Map<E,java.lang.Integer> |
edgeIndices
Allocation table
|
Constructor and Description |
---|
EdgeIndexFunctionImpl()
Constructor
|
Modifier and Type | Method and Description |
---|---|
private EdgeIndexFunctionImpl.Pair<java.lang.Integer,java.util.Map<E,java.lang.Integer>> |
allocate(edu.uci.ics.jung.graph.Graph<V,E> graph)
Layout edge heights
|
private int |
allocateHeight(E edge0,
edu.uci.ics.jung.graph.Graph<V,E> graph,
java.util.Map<E,java.lang.Integer> edge2HeightMap)
Allocate height slot (0-based)
|
private int |
compareTo(V v1,
V v2)
Compare vertex indices
|
private EdgeIndexFunctionImpl.Pair<V,V> |
getEnds(E edge,
edu.uci.ics.jung.graph.Graph<V,E> graph)
Get edge ends (lowest first, as if undirected)
|
int |
getIndex(edu.uci.ics.jung.graph.Graph<V,E> graph,
E edge) |
(package private) void |
init(edu.uci.ics.jung.graph.Graph<V,E> graph)
Initialize
|
private boolean |
join(E edge1,
E edge2,
edu.uci.ics.jung.graph.Graph<V,E> graph)
Whether first edge joins second (its target is the second's source or target)
|
(package private) java.util.Comparator<E> |
makeEdgeIndexComparator()
Get edge index comparator
|
private boolean |
overlap(E edge1,
E edge2,
edu.uci.ics.jung.graph.Graph<V,E> graph)
Whether edges overlap
|
void |
reset() |
void |
reset(edu.uci.ics.jung.graph.Graph<V,E> g,
E edge) |
protected java.util.Map<E,java.lang.Integer> edgeIndices
public void reset()
private EdgeIndexFunctionImpl.Pair<java.lang.Integer,java.util.Map<E,java.lang.Integer>> allocate(edu.uci.ics.jung.graph.Graph<V,E> graph)
graph
- graphprivate int allocateHeight(E edge0, edu.uci.ics.jung.graph.Graph<V,E> graph, java.util.Map<E,java.lang.Integer> edge2HeightMap)
edge0
- target edge to find height forgraph
- graphedge2HeightMap
- edge to height mapprivate EdgeIndexFunctionImpl.Pair<V,V> getEnds(E edge, edu.uci.ics.jung.graph.Graph<V,E> graph)
edge
- edgegraph
- graphprivate boolean overlap(E edge1, E edge2, edu.uci.ics.jung.graph.Graph<V,E> graph)
edge1
- edgeedge2
- edgegraph
- graphprivate boolean join(E edge1, E edge2, edu.uci.ics.jung.graph.Graph<V,E> graph)
edge1
- edge 1edge2
- edge 2graph
- graphprivate int compareTo(V v1, V v2)
v1
- vertex1v2
- vertex2final java.util.Comparator<E> makeEdgeIndexComparator()