public String getDictionaryType ( String identifier ) { Entry [ ] dictEntries = dict . getEntries ( ) ; String specRef = getSpecRef ( identifier ) ; logger . debug ( "Got identifier: " + identifier ) ; logger . debug ( "Final spec ref: " + specRef ) ; for ( Entry dictEntry : dictEntries ) { if ( ! dictEntry . getClassName ( ) . equals ( "Descriptor" ) ) continue ; if ( dictEntry . getID ( ) . equals ( specRef . toLowerCase ( ) ) ) { Element rawElement = ( Element ) dictEntry . getRawContent ( ) ; // assert(rawElement != null); // We're not fully Java 1.5 yet, so commented it out now. If it is // really important to have it, then add @cdk.require java1.5 in the // Class javadoc (and all classes that use this class) Elements classifications = rawElement . getChildElements ( "isClassifiedAs" , dict . getNS ( ) ) ; for ( int i = 0 ; i < classifications . size ( ) ; i ++ ) { Element element = classifications . get ( i ) ; Attribute attr = element . getAttribute ( "resource" , rdfNS ) ; if ( ( attr . getValue ( ) . indexOf ( "molecularDescriptor" ) != - 1 ) || ( attr . getValue ( ) . indexOf ( "atomicDescriptor" ) != - 1 ) ) { String [ ] tmp = attr . getValue ( ) . split ( "#" ) ; return tmp [ 1 ] ; } } } } return null ; }
Returns the type of the descriptor as defined in the descriptor dictionary .