private boolean getIfCarbonIsHydrophobic ( IAtomContainer ac , IAtom atom ) { List first = ac . getConnectedAtomsList ( atom ) ; List second = null ; List third = null ; //org.openscience.cdk.interfaces.IAtom[] fourth = null; if ( first . size ( ) > 0 ) { for ( int i = 0 ; i < first . size ( ) ; i ++ ) { IAtom firstAtom = ( IAtom ) first . get ( i ) ; if ( firstAtom . getSymbol ( ) . equals ( "C" ) || firstAtom . getSymbol ( ) . equals ( "H" ) ) { } else { return false ; } second = ac . getConnectedAtomsList ( firstAtom ) ; if ( second . size ( ) > 0 ) { for ( int b = 0 ; b < second . size ( ) ; b ++ ) { IAtom secondAtom = ( IAtom ) second . get ( b ) ; if ( secondAtom . getSymbol ( ) . equals ( "C" ) || secondAtom . getSymbol ( ) . equals ( "H" ) ) { } else { return false ; } third = ac . getConnectedAtomsList ( secondAtom ) ; if ( third . size ( ) > 0 ) { for ( int c = 0 ; c < third . size ( ) ; c ++ ) { IAtom thirdAtom = ( IAtom ) third . get ( c ) ; if ( thirdAtom . getSymbol ( ) . equals ( "C" ) || thirdAtom . getSymbol ( ) . equals ( "H" ) ) { } else { return false ; } //fourth = ac.getConnectedAtoms(third[c]); //if (fourth.length > 0) { // for (int d = 0; d < fourth.length; d++) { // if (fourth[d].getSymbol().equals("C") || fourth[d].getSymbol().equals("H")) { // } else { // return false; // } // } //} else { // return false; //} } } else { return false ; } } } else { return false ; } } } else { return false ; } return true ; }
Gets the ifCarbonIsHydrophobic attribute of the XLogPDescriptor object . C must be sp2 or sp3 and for all distances C - 1 - 2 - 3 only C atoms are permitted