Beispiel #1
0
 @SuppressWarnings("null")
 @Override
 public int compareTo(Path o) {
   if (this.nodePath != null && o.getNodePath() != null) {
     return Integer.compare(this.nodePath.size(), o.getNodePath().size());
   }
   return (Integer) null;
 }
Beispiel #2
0
  public Path Clone() {
    Path p = new Path(this.getSource(), this.getDestination(), this.getId());
    LinkedList<Vertex> nodesList = new LinkedList<>();
    LinkedList<Link> linkList = new LinkedList<>();

    for (Vertex v : this.getNodePath()) nodesList.add(v);

    for (Link l : this.getEdgePath()) linkList.add(l);

    p.setEdgePath(linkList);
    p.setNodePath(nodesList);

    return p;
  }