|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--net.walend.measured.AbstractShortestGEDistances
AbstractShortestGEDistances contains a 2D array of distances between nodes in a directed graph. This class holds a lot of common workhorse methods used by other classes.
| Field Summary | |
private IndexedGEDigraph |
base
|
private int[][] |
distances
|
private GEPathMeter |
pathMeter
|
| Constructor Summary | |
protected |
AbstractShortestGEDistances(IndexedGEDigraph ceDigraph,
GEPathMeter pathMeter)
|
| Method Summary | |
protected void |
bfTest()
|
IndexedGEDigraph |
getBase()
|
int |
getLength(int from,
int to)
|
int |
getLength(java.lang.Object fromNode,
java.lang.Object toNode)
|
GEPathMeter |
getPathMeter()
Return the path meter used to evaluate these shortest paths. |
java.lang.Class |
getPrincipleInterface()
Returns the class's principle interface for state comparisons. |
protected void |
initializeDistances()
|
abstract void |
recalculate()
Rediscover the shortest paths. |
protected void |
relax(int fromIndex,
int throughIndex,
int toIndex)
|
protected int |
safeLength(int from,
int to)
|
boolean |
sameStateAs(HasState victim)
If two HasStates have the same internal state, return true. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
private int[][] distances
private GEPathMeter pathMeter
private IndexedGEDigraph base
| Constructor Detail |
protected AbstractShortestGEDistances(IndexedGEDigraph ceDigraph,
GEPathMeter pathMeter)
throws GENegativeWeightCycleException
| Method Detail |
protected void bfTest()
throws GENegativeWeightCycleException
GENegativeWeightCycleExceptionpublic IndexedGEDigraph getBase()
getBase in interface ShortestGEDistancesprotected void initializeDistances()
protected void relax(int fromIndex,
int throughIndex,
int toIndex)
public abstract void recalculate()
throws GENegativeWeightCycleException
recalculate in interface ShortestGEDistancesGENegativeWeightCycleExceptionpublic GEPathMeter getPathMeter()
getPathMeter in interface ShortestGEDistances
public int getLength(int from,
int to)
getLength in interface ShortestGEDistances
protected final int safeLength(int from,
int to)
public int getLength(java.lang.Object fromNode,
java.lang.Object toNode)
throws NodeMissingException
getLength in interface ShortestGEDistancesNodeMissingExceptionpublic java.lang.Class getPrincipleInterface()
HasState
getPrincipleInterface in interface HasStatepublic boolean sameStateAs(HasState victim)
HasStateFor objects with subobjects, Generally this method should only return true if the internal objects are equal. Implement a contentsHaveSameState() method to determine if the contents have the same state.
sameStateAs in interface HasStatepublic java.lang.String toString()
toString in class java.lang.Object
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||