be.ac.ulg.montefiore.run.totem.domain.model.impl
Class PathImpl

java.lang.Object
  extended by be.ac.ulg.montefiore.run.totem.domain.model.impl.PathImpl
All Implemented Interfaces:
Path

public class PathImpl
extends java.lang.Object
implements Path

Represent a Path in a Domain and is used by a LSP

Creation date: 20-Jan-2005 10:45:08

Author:
Fabian Skivee (skivee@run.montefiore.ulg.ac.be)

Constructor Summary
PathImpl(Domain domain)
           
 
Method Summary
 boolean containsLink(Link link)
          Return true if the path contains the link Link
 void createPathFromLink(java.util.List<Link> path)
          Create a Path from a list of Link
 void createPathFromNode(java.util.List<Node> path)
          Create a Path from a list of Node
 boolean equals(java.lang.Object o)
           
 boolean equals(Path path)
          Return true if the path is equal to the given Path
 Node getDestinationNode()
          Get the destination node
 java.util.List<Link> getLinkPath()
          Get the path as a List of Link
 java.util.List<Node> getNodePath()
          Get the path as a List of Node
 Node getSourceNode()
          Get the source node
 float getSumLinkMetrics()
          Get the cost of the path
 int hashCode()
           
 java.lang.String toLinksString()
          Get a String displaying the path as link ids
 java.lang.String toNodesString()
          Get a String displaying the path as node ids
 java.lang.String toString()
          Get a String displaying the path as node id
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PathImpl

public PathImpl(Domain domain)
Method Detail

createPathFromLink

public void createPathFromLink(java.util.List<Link> path)
                        throws NodeNotFoundException,
                               InvalidPathException
Create a Path from a list of Link

Specified by:
createPathFromLink in interface Path
Parameters:
path -
Throws:
NodeNotFoundException
InvalidPathException - When the path is not continuous

createPathFromNode

public void createPathFromNode(java.util.List<Node> path)
                        throws NodeNotFoundException,
                               InvalidPathException
Create a Path from a list of Node

Specified by:
createPathFromNode in interface Path
Parameters:
path -
Throws:
NodeNotFoundException
InvalidPathException - When the path is not continuous

getLinkPath

public java.util.List<Link> getLinkPath()
Get the path as a List of Link

Specified by:
getLinkPath in interface Path
Returns:

getNodePath

public java.util.List<Node> getNodePath()
Get the path as a List of Node

Specified by:
getNodePath in interface Path
Returns:

getSourceNode

public Node getSourceNode()
Get the source node

Specified by:
getSourceNode in interface Path
Returns:

getSumLinkMetrics

public float getSumLinkMetrics()
Get the cost of the path

Specified by:
getSumLinkMetrics in interface Path
Returns:

getDestinationNode

public Node getDestinationNode()
Get the destination node

Specified by:
getDestinationNode in interface Path
Returns:

containsLink

public boolean containsLink(Link link)
Return true if the path contains the link Link

Specified by:
containsLink in interface Path
Parameters:
link -
Returns:

equals

public boolean equals(Path path)
Return true if the path is equal to the given Path

Specified by:
equals in interface Path
Parameters:
path -
Returns:

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Get a String displaying the path as node id

Specified by:
toString in interface Path
Overrides:
toString in class java.lang.Object
Returns:

toNodesString

public java.lang.String toNodesString()
Description copied from interface: Path
Get a String displaying the path as node ids

Specified by:
toNodesString in interface Path
Returns:

toLinksString

public java.lang.String toLinksString()
Description copied from interface: Path
Get a String displaying the path as link ids

Specified by:
toLinksString in interface Path
Returns:


Copyright © 2004-2007 Research Unit in Networking, All Rights Reserved.