code: private int getCarbonsCount(IAtomContainer ac, IAtom atom) {
          List<IAtom> neighbours = ac.getConnectedAtomsList(atom);
          int ccounter = 0;
          for (IAtom neighbour : neighbours) {
              if (neighbour.getSymbol().equals("C")) {
                  if (!neighbour.getFlag(CDKConstants.ISAROMATIC)) {
                      ccounter += 1;
                  }
              }
          }
          return ccounter;
      }
docs: Gets the carbonsCount attribute of the XLogPDescriptor object.
  
  @param  ac    Description of the Parameter
  @param  atom  Description of the Parameter
  @return       The carbonsCount value