|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--net.walend.measured.AbstractShortestCEDistances
AbstractShortestCEDistances 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 IndexedCEDigraph |
base
|
private int[][] |
distances
|
private CEPathMeter |
pathMeter
|
Constructor Summary | |
protected |
AbstractShortestCEDistances(IndexedCEDigraph ceDigraph,
CEPathMeter pathMeter)
|
Method Summary | |
protected void |
bfTest()
|
IndexedCEDigraph |
getBase()
|
int |
getLength(int from,
int to)
|
int |
getLength(java.lang.Object fromNode,
java.lang.Object toNode)
|
CEPathMeter |
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 CEPathMeter pathMeter
private IndexedCEDigraph base
Constructor Detail |
protected AbstractShortestCEDistances(IndexedCEDigraph ceDigraph, CEPathMeter pathMeter) throws CENegativeWeightCycleException
Method Detail |
protected void bfTest() throws CENegativeWeightCycleException
CENegativeWeightCycleException
public IndexedCEDigraph getBase()
getBase
in interface ShortestCEDistances
protected void initializeDistances()
protected void relax(int fromIndex, int throughIndex, int toIndex)
public abstract void recalculate() throws CENegativeWeightCycleException
recalculate
in interface ShortestCEDistances
CENegativeWeightCycleException
public CEPathMeter getPathMeter()
getPathMeter
in interface ShortestCEDistances
public int getLength(int from, int to)
getLength
in interface ShortestCEDistances
protected final int safeLength(int from, int to)
public int getLength(java.lang.Object fromNode, java.lang.Object toNode) throws NodeMissingException
getLength
in interface ShortestCEDistances
NodeMissingException
public java.lang.Class getPrincipleInterface()
HasState
getPrincipleInterface
in interface HasState
public boolean sameStateAs(HasState victim)
HasState
For 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 HasState
public 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 |