Ejemplo n.º 1
0
        /// <summary>
        /// returns the nodes associated with the given collection of links
        /// </summary>
        private ArrayList GetNeighbours(atomCollection links_collection)
        {
            ArrayList neighbours = new ArrayList();

            if (links_collection != null)
            {
                for (int i = 0; i < links_collection.Count(); i++)
                {
                    // each link
                    atom lnk = links_collection.Get(i);
                    if (lnk.atoms_incoming != null)
                    {
                        // each node referred to by the link
                        for (int j = 0; j < lnk.atoms_incoming.Count(); j++)
                        {
                            neighbours.Add(lnk.atoms_incoming.Get(j));
                        }
                    }
                }
            }

            return(neighbours);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// returns the given collection as a set of link objects
 /// </summary>
 public ArrayList GetLinks(atomCollection collection)
 {
     ArrayList links = new ArrayList();
     if (collection != null)
     {
         for (int i = 0; i < collection.Count(); i++)
         {
             atom a = collection.Get(i);
             if (a.GetFlag(atom.FLAG_IS_LINK))
             {
                 links.Add((link)a);
             }
         }
     }
     return(links);
 }