Gets the presenceOfN=O attribute of the XLogPDescriptor object.

@param  ac    Description of the Parameter
@param  atom  Description of the Parameter
@return       The presenceOfNitor [boolean]
13618
private boolean getPresenceOfNitro(IAtomContainer ac, IAtom atom) {
        List neighbours = ac.getConnectedAtomsList(atom);
        List second = null;
        IBond bond = null;
        //int counter = 0;
        for (int i = 0; i < neighbours.size(); i++) {
            IAtom neighbour = (IAtom) neighbours.get(i);
            if (neighbour.getSymbol().equals("N")) {
                second = ac.getConnectedAtomsList(neighbour);
                for (int b = 0; b < second.size(); b++) {
                    IAtom conAtom = (IAtom) second.get(b);
                    if (conAtom.getSymbol().equals("O")) {
                        bond = ac.getBond(neighbour, conAtom);
                        if (bond.getOrder() == IBond.Order.DOUBLE) {
                            return true;
                        }
                    }
                }
            }
        }
        return false;
    }
1210178
public static Boolean getBoolean(final LdapEntry ctx, final String attribute) {
        return getBoolean(ctx, attribute, Boolean.FALSE);
    }
807062
private static int charge(IAtom atom) {
        Integer charge = atom.getFormalCharge();
        if (charge != null) return charge;
        return 0;
    }
305103
public byte[] getAC() {

    Element acElement = (Element) xmlResponse.getElementsByTagName("ac")
      .item(0);

    if (acElement == null || !acElement.hasChildNodes())
      return null;

    String acString = acElement.getFirstChild().getNodeValue();

    ACDecodingStrategy acDecodingStrategy = new GoodACDecodingStrategy();

    byte[] decodedAc = acDecodingStrategy.decode(acString);

    return decodedAc;
  }
341700
public IAtom getOtherBondAtom(IAtom atom, IBond bond) {
        if (!bond.contains(atom)) return null;
        if (bond.getBegin().equals(atom))
            return bond.getEnd();
        else
            return bond.getBegin();
    }
1191855
private int getDoubleBondedOxygenCount(IAtomContainer ac, IAtom atom) {
        List<IAtom> neighbours = ac.getConnectedAtomsList(atom);
        IBond bond;
        int odbcounter = 0;
        boolean chargeFlag = false;
        if (atom.getFormalCharge() >= 1) {
            chargeFlag = true;
        }
        for (IAtom neighbour : neighbours) {
            if (neighbour.getSymbol().equals("O")) {
                bond = ac.getBond(neighbour, atom);
                if (chargeFlag && neighbour.getFormalCharge() == -1 && bond.getOrder() == IBond.Order.SINGLE) {
                    odbcounter += 1;
                }
                if (!neighbour.getFlag(CDKConstants.ISAROMATIC)) {
                    if (bond.getOrder() == IBond.Order.DOUBLE) {
                        odbcounter += 1;
                    }
                }
            }
        }
        return odbcounter;
    }
935046
private int getDoubleBondedNitrogenCount(IAtomContainer ac, IAtom atom) {
        List<IAtom> neighbours = ac.getConnectedAtomsList(atom);
        IBond bond;
        int ndbcounter = 0;
        for (IAtom neighbour : neighbours) {
            if (neighbour.getSymbol().equals("N")) {
                bond = ac.getBond(neighbour, atom);
                if (!neighbour.getFlag(CDKConstants.ISAROMATIC)) {
                    if (bond.getOrder() == IBond.Order.DOUBLE) {
                        ndbcounter += 1;
                    }
                }
            }
        }
        return ndbcounter;
    }
1143590
@Override
    public boolean matches(IAtom atom) {
        return Preconditions.checkNotNull(atom.getAtomicNumber(), "Atomic number is not set.").equals(
                this.getAtomicNumber());
    }
972305
@Override
    public DescriptorValue calculate(IAtomContainer atomContainer) {
        int hBondAcceptors = 0;

        IAtomContainer ac;
        try {
            ac = (IAtomContainer) atomContainer.clone();
        } catch (CloneNotSupportedException e) {
            return getDummyDescriptorValue(e);
        }

        // aromaticity is detected prior to descriptor calculation if the respective parameter is set to true

        if (checkAromaticity) {
            try {
                AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(ac);
                Aromaticity.cdkLegacy().apply(ac);
            } catch (CDKException e) {
                return getDummyDescriptorValue(e);
            }
        }

        //org.openscience.cdk.interfaces.IAtom[] atoms = ac.getAtoms();
        // labelled for loop to allow for labelled continue statements within the loop
        atomloop: for (IAtom atom : ac.atoms()) {
            // looking for suitable nitrogen atoms
            if (atom.getSymbol().equals("N") && atom.getFormalCharge() <= 0) {

                // excluding nitrogens that are adjacent to an oxygen
                List<IBond> bonds = ac.getConnectedBondsList(atom);
                int nPiBonds = 0;
                for (IBond bond : bonds) {
                    if (bond.getOther(atom).getSymbol().equals("O")) continue atomloop;
                    if (IBond.Order.DOUBLE.equals(bond.getOrder())) nPiBonds++;
                }

                // if the nitrogen is aromatic and there are no pi bonds then it's
                // lone pair cannot accept any hydrogen bonds
                if (atom.getFlag(CDKConstants.ISAROMATIC) && nPiBonds == 0) continue;

                hBondAcceptors++;
            }
            // looking for suitable oxygen atoms
            else if (atom.getSymbol().equals("O") && atom.getFormalCharge() <= 0) {
                //excluding oxygens that are adjacent to a nitrogen or to an aromatic carbon
                List<IBond> neighbours = ac.getConnectedBondsList(atom);
                for (IBond bond : neighbours) {
                    IAtom neighbor = bond.getOther(atom);
                    if (neighbor.getSymbol().equals("N") ||
                        (neighbor.getSymbol().equals("C") &&
                         neighbor.isAromatic() &&
                         bond.getOrder() != IBond.Order.DOUBLE))
                        continue atomloop;;
                }
                hBondAcceptors++;
            }
        }

        return new DescriptorValue(getSpecification(), getParameterNames(), getParameters(), new IntegerResult(
                hBondAcceptors), getDescriptorNames());
    }
1354257
private int getAromaticCarbonsCount(IAtomContainer ac, IAtom atom) {
        List<IAtom> neighbours = ac.getConnectedAtomsList(atom);
        int carocounter = 0;
        for (IAtom neighbour : neighbours) {
            if (neighbour.getSymbol().equals("C") && neighbour.getFlag(CDKConstants.ISAROMATIC)) {
                carocounter += 1;
            }
        }
        return carocounter;
    }
667363
private IAtom getAnotherUnsaturatedNode(IAtom exclusionAtom) throws CDKException {
        IAtom atom;
        int next = random.nextInt(atomContainer.getAtomCount());

        for (int f = next; f < atomContainer.getAtomCount(); f++) {
            atom = atomContainer.getAtom(f);
            if (!satCheck.isSaturated(atom, atomContainer) && !exclusionAtom.equals(atom)
                    && !atomContainer.getConnectedAtomsList(exclusionAtom).contains(atom)) {
                return atom;
            }
        }
        for (int f = 0; f < next; f++) {
            atom = atomContainer.getAtom(f);
            if (!satCheck.isSaturated(atom, atomContainer) && !exclusionAtom.equals(atom)
                    && !atomContainer.getConnectedAtomsList(exclusionAtom).contains(atom)) {
                return atom;
            }
        }
        return null;
    }
344614
public IAtomContainer getPlacedAtomsInAtomContainer(IAtom atom, IAtomContainer ac) {

        List bonds = ac.getConnectedBondsList(atom);
        IAtomContainer connectedAtoms = atom.getBuilder().newInstance(IAtomContainer.class);
        IAtom connectedAtom = null;
        for (int i = 0; i < bonds.size(); i++) {
            connectedAtom = ((IBond) bonds.get(i)).getOther(atom);
            if (connectedAtom.getFlag(CDKConstants.ISPLACED)) {
                connectedAtoms.addAtom(connectedAtom);
            }
        }
        return connectedAtoms;
    }
95591
@Override
    public DescriptorValue calculate(IAtomContainer ac) {
        ac = clone(ac); // don't mod original
        int rotatableBondsCount = 0;
        int degree0;
        int degree1;
        IRingSet ringSet;
        try {
            ringSet = new SpanningTree(ac).getBasicRings();
        } catch (NoSuchAtomException e) {
            return new DescriptorValue(getSpecification(), getParameterNames(), getParameters(), new IntegerResult(
                    (int) Double.NaN), getDescriptorNames(), e);
        }
        for (IBond bond : ac.bonds()) {
            if (ringSet.getRings(bond).getAtomContainerCount() > 0) {
                bond.setFlag(CDKConstants.ISINRING, true);
            }
        }
        for (IBond bond : ac.bonds()) {
            IAtom atom0 = bond.getBegin();
            IAtom atom1 = bond.getEnd();
            if (atom0.getSymbol().equals("H") || atom1.getSymbol().equals("H")) continue;
            if (bond.getOrder() == Order.SINGLE) {
                if ((BondManipulator.isLowerOrder(ac.getMaximumBondOrder(atom0), IBond.Order.TRIPLE))
                        && (BondManipulator.isLowerOrder(ac.getMaximumBondOrder(atom1), IBond.Order.TRIPLE))) {
                    if (!bond.getFlag(CDKConstants.ISINRING)) {

                        if (excludeAmides && (isAmide(atom0, atom1, ac) || isAmide(atom1, atom0, ac))) {
                            continue;
                        }

                        // if there are explicit H's we should ignore those bonds
                        degree0 = ac.getConnectedBondsCount(atom0) - getConnectedHCount(ac, atom0);
                        degree1 = ac.getConnectedBondsCount(atom1) - getConnectedHCount(ac, atom1);
                        if ((degree0 == 1) || (degree1 == 1)) {
                            if (includeTerminals) {
                                rotatableBondsCount += 1;
                            }
                        } else {
                            rotatableBondsCount += 1;
                        }
                    }
                }
            }
        }
        return new DescriptorValue(getSpecification(), getParameterNames(), getParameters(), new IntegerResult(
                rotatableBondsCount), getDescriptorNames());

    }
108687
public static IAtom getAtomById(IAtomContainer ac, String id) throws CDKException {
        for (int i = 0; i < ac.getAtomCount(); i++) {
            if (ac.getAtom(i).getID() != null && ac.getAtom(i).getID().equals(id)) return ac.getAtom(i);
        }
        throw new CDKException("no suc atom");
    }
942121
public int getTypeAnnotation() {
        int type = 0;
        if (nodeKind == ATTRIBUTE) {
            type = StandardNames.XS_UNTYPED_ATOMIC;
        } else {
            type = StandardNames.XS_UNTYPED;
        }
        return type;
    }
854562
private XlsRecordOption getRecordOptionAnnotation(final FieldAccessor accessor) {

        return accessor.getAnnotation(XlsRecordOption.class)
                .orElseGet(() -> new XlsRecordOption() {

                    @Override
                    public Class<? extends Annotation> annotationType() {
                        return XlsRecordOption.class;
                    }

                    @Override
                    public RemainedOperation remainedOperation() {
                        return RemainedOperation.None;
                    }

                    @Override
                    public OverOperation overOperation() {
                        return OverOperation.Break;
                    }
                });


    }
1063162
public boolean isSaturated(IAtom atom, IAtomContainer ac) throws CDKException {
        createAtomTypeFactory(ac.getBuilder());
        IAtomType atomType = factory.getAtomType(atom.getAtomTypeName());
        int lpCount = (Integer) atomType.getProperty(CDKConstants.LONE_PAIR_COUNT);
        int foundLPCount = ac.getConnectedLonePairsCount(atom);
        return foundLPCount >= lpCount;
    }