Obtain the number of centres adjacent to the atom at the index, i.

@param i atom index
@return number of adjacent centres
2388
private int nAdjacentCentres(int i) {
        int n = 0;
        for (IAtom atom : tetrahedralElements[i].getLigands())
            if (tetrahedralElements[atomToIndex.get(atom)] != null) n++;
        return n;
    }
637374
public String getNumericName(int i )
    {
        if(i < getNumNumericalVars() && i >= 0)
            return numericalVariableNames.getOrDefault(i, "Numeric Feature " + i);
        else
            throw new IndexOutOfBoundsException("Can not acces variable for invalid index  " + i );
    }
1309021
@Override
    public int getConnectedLonePairsCount(IAtom atom) {
        int count = 0;
        for (int i = 0; i < lonePairCount; i++) {
            if (lonePairs[i].contains(atom)) ++count;
        }
        return count;
    }
1101609
public int getFaceNumIndices(int face) {
        if (null == m_faceOffsets) {
            if (face >= m_numFaces || face < 0) {
                throw new IndexOutOfBoundsException("Index: " + face + 
                        ", Size: " + m_numFaces);
            }
            return 3;
        }
        else {
            /* 
             * no need to perform bound checks here as the array access will
             * throw IndexOutOfBoundsExceptions if the index is invalid
             */
            
            if (face == m_numFaces - 1) {
                return m_faces.capacity() / 4 - m_faceOffsets.getInt(face * 4);
            }
            
            return m_faceOffsets.getInt((face + 1) * 4) - 
                    m_faceOffsets.getInt(face * 4);
        }
    }
337686
public Relation getRelations(int i) {
    if (Document_Type.featOkTst && ((Document_Type)jcasType).casFeat_relations == null)
      jcasType.jcas.throwFeatMissing("relations", "de.julielab.jules.types.ace.Document");
    jcasType.jcas.checkArrayBounds(jcasType.ll_cas.ll_getRefValue(addr, ((Document_Type)jcasType).casFeatCode_relations), i);
    return (Relation)(jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefArrayValue(jcasType.ll_cas.ll_getRefValue(addr, ((Document_Type)jcasType).casFeatCode_relations), i)));}
532724
public RelationMention getMentions(int i) {
    if (Relation_Type.featOkTst && ((Relation_Type)jcasType).casFeat_mentions == null)
      jcasType.jcas.throwFeatMissing("mentions", "de.julielab.jules.types.ace.Relation");
    jcasType.jcas.checkArrayBounds(jcasType.ll_cas.ll_getRefValue(addr, ((Relation_Type)jcasType).casFeatCode_mentions), i);
    return (RelationMention)(jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefArrayValue(jcasType.ll_cas.ll_getRefValue(addr, ((Relation_Type)jcasType).casFeatCode_mentions), i)));}
602634
public static int getNumBondsInGroup(List<Atom> atomsInGroup) {
		int bondCounter = 0;
		for(Atom atom : atomsInGroup) {
			if(atom.getBonds()==null){
				continue;
			}
			for(Bond bond : atom.getBonds()) {
				// Now set the bonding information.
				Atom other = bond.getOther(atom);
				// If both atoms are in the group
				if (atomsInGroup.indexOf(other)!=-1){
					Integer firstBondIndex = atomsInGroup.indexOf(atom);
					Integer secondBondIndex = atomsInGroup.indexOf(other);
					// Don't add the same bond twice
					if (firstBondIndex<secondBondIndex){
						bondCounter++;
					}
				}
			}
		}
		return bondCounter;
	}
218625
private int findFirst(CharSequence input, int beginIndex, int rewindIndex) {
        int first = -1;
        boolean atomBoundary = true;
        for (int i = beginIndex; i >= rewindIndex; i--) {
            char c = input.charAt(i);
            if (localAtomAllowed(c)) {
                first = i;
                atomBoundary = false;
            } else if (c == '.') {
                if (atomBoundary) {
                    break;
                }
                atomBoundary = true;
            } else {
                break;
            }
        }
        return first;
    }
88338
private int otherIndex(int i) {
        IDoubleBondStereochemistry element = (IDoubleBondStereochemistry) queryElements[i];
        return queryMap.get(element.getStereoBond().getOther(query.getAtom(i)));
    }
369743
public Identifier getIdentifier(int i) {
        return mIdentifiers.size() > i ? mIdentifiers.get(i) : null;
    }
482713
public int middleIndex()
  {
    int x = midPoint();
    int r = rightMostIndex();
    if (r < midPoint())
      x = r;
    return x;
  }
989857
public int prevSetBit(final int i) {
    int x = i >> 6; // signed i / 64
    long w = bitmap.get(x);
    w <<= 64 - i - 1;
    if (w != 0) {
      return i - Long.numberOfLeadingZeros(w);
    }
    for (--x; x >= 0; --x) {
      long X = bitmap.get(x);
      if (X != 0) {
        return x * 64 + 63 - Long.numberOfLeadingZeros(X);
      }
    }
    return -1;
  }
675703
public Stoichiometry getComponent(int i) {
		return new Stoichiometry(Collections.singletonList(orderedClusters.get(i)),this.strategy,false);
	}
654880
private int getOxygenCount(IAtomContainer ac, IAtom atom) {
        List<IAtom> neighbours = ac.getConnectedAtomsList(atom);
        int ocounter = 0;
        for (IAtom neighbour : neighbours) {
            if (neighbour.getSymbol().equals("O")) {
                if (!neighbour.getFlag(CDKConstants.ISAROMATIC)) {
                    ocounter += 1;
                }
            }
        }
        return ocounter;
    }
146640
private int[] neighbors(ITetrahedralChirality element, Map<IAtom, Integer> map) {
        IAtom[] atoms = element.getLigands();
        int[] vs = new int[atoms.length];
        for (int i = 0; i < atoms.length; i++)
            vs[i] = map.get(atoms[i]);
        return vs;
    }
507113
private boolean isTerminal(IAtom atom, Map<IAtom, Integer> atomToIndex) {
        return graph[atomToIndex.get(atom)].length == 1;
    }
5025
public int prevClearBit(final int i) {
    int x = i >> 6; // i / 64 with sign extension
    long w = ~bitmap.get(x);
    w <<= 64 - i - 1;
    if (w != 0L) {
      return i - Long.numberOfLeadingZeros(w);
    }
    for (--x; x >= 0; --x) {
      long map = ~bitmap.get(x);
      if (map != 0L) {
        return x * 64 + 63 - Long.numberOfLeadingZeros(map);
      }
    }
    return -1;
  }