|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnz.ac.waikato.mcennis.rat.graph.model.ModelShell
nz.ac.waikato.mcennis.rat.graph.path.BasicPath
public class BasicPath
Class for a basic Path implementation
| Field Summary |
|---|
| Fields inherited from class nz.ac.waikato.mcennis.rat.graph.model.ModelShell |
|---|
listener |
| Fields inherited from interface nz.ac.waikato.mcennis.rat.graph.path.Path |
|---|
ADD_ACTOR, SET_PATH, WEAK |
| Constructor Summary | |
|---|---|
BasicPath()
Creates a new instance of BasicPath |
|
| Method Summary | |
|---|---|
Path |
addActor(Actor a,
double cost)
Create a new path that contains all the contents of this path plus an additional link to the given actor with the additional cost given. |
boolean |
contains(Actor node)
returns if the path contains the given actor |
double |
getCost()
return the total cost of this path |
Actor |
getEnd()
return the last actor in this path |
Actor[] |
getMiddle()
return all actors that are neither the start or end actors. |
Actor[] |
getPath()
Returns the order array of the actors in this object. |
Actor |
getStart()
Return the first actor in the path |
java.lang.String |
getType()
Returns the PathSet id of this path |
boolean |
isWeak()
returns if this path ever traverses a link in the wrong direction. |
void |
setPath(Actor[] participants,
double cost,
java.lang.String type)
Create a path that goes through the following actors in order with a total cost and given id representing this PathSet id. |
void |
setWeak(boolean weak)
Set that the path traverses the wrong direction on at least one link between actors. |
| Methods inherited from class nz.ac.waikato.mcennis.rat.graph.model.ModelShell |
|---|
addListener, fireChange |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface nz.ac.waikato.mcennis.rat.graph.model.Model |
|---|
addListener |
| Constructor Detail |
|---|
public BasicPath()
| Method Detail |
|---|
public void setPath(Actor[] participants,
double cost,
java.lang.String type)
Path
setPath in interface Pathparticipants - actors in this path in ordercost - total cost (strength) of this pathtype - PathSet id of this pathpublic void setWeak(boolean weak)
Path
setWeak in interface Path
public Actor[] getPath()
throws NotConstructedError
Path
getPath in interface PathNotConstructedError
public Actor getStart()
throws NotConstructedError
Path
getStart in interface PathNotConstructedError
public Actor getEnd()
throws NotConstructedError
Path
getEnd in interface PathNotConstructedError
public Actor[] getMiddle()
throws NotConstructedError
Path
getMiddle in interface PathNotConstructedError
public double getCost()
throws NotConstructedError
Path
getCost in interface PathNotConstructedError
public boolean isWeak()
throws NotConstructedError
Path
isWeak in interface PathNotConstructedError
public boolean contains(Actor node)
throws NotConstructedError
Path
contains in interface Pathnode - actor to be checked
NotConstructedErrorpublic java.lang.String getType()
Path
getType in interface Path
public Path addActor(Actor a,
double cost)
throws NotConstructedError
Path
addActor in interface Patha - actor to be addedcost - cost to be added to the path cost
NotConstructedError
|
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||