code: private int getAtomTypeXCount(IAtomContainer ac, IAtom atom) {
          List<IAtom> neighbours = ac.getConnectedAtomsList(atom);
          int nocounter = 0;
          IBond bond;
          for (IAtom neighbour : neighbours) {
              if ((neighbour.getSymbol().equals("N") || neighbour.getSymbol().equals("O"))
                      && !(Boolean) neighbour.getProperty("IS_IN_AROMATIC_RING")) {
                  //if (ac.getMaximumBondOrder(neighbours[i]) == 1.0) {
                  bond = ac.getBond(neighbour, atom);
                  if (bond.getOrder() != IBond.Order.DOUBLE) {
                      nocounter += 1;
                  }
              }
          }
          return nocounter;
      }
docs: Gets the atomType X Count attribute of the XLogPDescriptor object.
  
  @param  ac    Description of the Parameter
  @param  atom  Description of the Parameter
  @return       The nitrogenOrOxygenCount value