private int getHybridisationState(IAtom atom1) {

        IBond.Order maxBondOrder = atom1.getMaxBondOrder();

        //        if (atom1.getFormalNeighbourCount() == 1 || maxBondOrder > 4) {
        if (atom1.getFormalNeighbourCount() == 1) {
            // WTF??
        } else if (atom1.getFormalNeighbourCount() == 2 || maxBondOrder == IBond.Order.TRIPLE) {
            return 1; //sp
        } else if (atom1.getFormalNeighbourCount() == 3 || (maxBondOrder == IBond.Order.DOUBLE)) {
            return 2; //sp2
        } else {
            return 3; //sp3
        }
        return -1;
    }
private int getHybridisationState ( IAtom atom1 ) { IBond . Order maxBondOrder = atom1 . getMaxBondOrder ( ) ; if ( atom1 . getFormalNeighbourCount ( ) == 1 ) { } else if ( atom1 . getFormalNeighbourCount ( ) == 2 || maxBondOrder == IBond . Order . TRIPLE ) { return 1 ; } else if ( atom1 . getFormalNeighbourCount ( ) == 3 || ( maxBondOrder == IBond . Order . DOUBLE ) ) { return 2 ; } else { return 3 ; } return - 1 ; }
Gets the hybridisation state of an atom.

@param  atom1  atom
@return        The hybridisationState value (sp=1;sp2=2;sp3=3)