Logo Search packages:      
Sourcecode: cdk version File versions  Download package

void org::openscience::cdk::graph::invariant::CanonicalLabeler::primeProduct ( ArrayList  v,
IAtomContainer  atomContainer 
) [inline, private]

Calculates the product of the neighbouring primes.

Parameters:
v the invariance pair vector

Definition at line 144 of file CanonicalLabeler.java.

References org::openscience::cdk::smiles::InvPair::getAtom(), org::openscience::cdk::interfaces::IAtomContainer::getConnectedAtomsList(), org::openscience::cdk::smiles::InvPair::getCurr(), org::openscience::cdk::interfaces::IChemObject::getProperty(), org::openscience::cdk::smiles::InvPair::setCurr(), and org::openscience::cdk::smiles::InvPair::setLast().

Referenced by step2().

                                                                       {
    Iterator it = v.iterator();
    Iterator n;
    InvPair inv;
    IAtom a;
    long summ;
    while (it.hasNext()) {
      inv = (InvPair) it.next();
      List neighbour = atomContainer.getConnectedAtomsList(inv.getAtom());
      n = neighbour.iterator();
      summ = 1;
      while (n.hasNext()) {
        a = (IAtom) n.next();
        int next = ((InvPair)a.getProperty(InvPair.INVARIANCE_PAIR)).getPrime();
        summ = summ * next;
      }
      inv.setLast(inv.getCurr());
      inv.setCurr(summ);
    }
  }


Generated by  Doxygen 1.6.0   Back to index