Exemplo n.º 1
0
 /* say if a link already exist between to node in the graph
  * (usefull for avoid duplicated links */
 private Boolean linkAlreadyExist(Node n1, Node n2) {
   for (Link l : links) {
     if (l.getSource().equals(n1) && l.getDestination().equals(n2)) {
       return true;
     }
   }
   return false;
 }
 protected boolean contains(Collection links, Object o) {
   for (Iterator iter = links.iterator(); iter.hasNext(); ) {
     Link link = (Link) iter.next();
     if (link.getSource() == o || link.getTarget() == o) {
       return true;
     }
   }
   return false;
 }
Exemplo n.º 3
0
 public static PVLink create(Link link) {
   return create(link.getSource(), link.getTarget(), link.getValue());
 }