示例#1
0
 /**
  * Returns a one line string representation of this Container. This method is conform RFC #9.
  *
  * @return The string representation of this Container
  */
 public String toString() {
   StringBuffer stringContent = new StringBuffer(64);
   stringContent.append("AtomContainer(");
   stringContent.append(this.hashCode());
   if (getAtomCount() > 0) {
     stringContent.append(", #A:").append(getAtomCount());
     for (int i = 0; i < getAtomCount(); i++) {
       stringContent.append(", ").append(getAtom(i).toString());
     }
   }
   if (getBondCount() > 0) {
     stringContent.append(", #B:").append(getBondCount());
     for (int i = 0; i < getBondCount(); i++) {
       stringContent.append(", ").append(getBond(i).toString());
     }
   }
   if (getLonePairCount() > 0) {
     stringContent.append(", #LP:").append(getLonePairCount());
     for (int i = 0; i < getLonePairCount(); i++) {
       stringContent.append(", ").append(getLonePair(i).toString());
     }
   }
   if (getSingleElectronCount() > 0) {
     stringContent.append(", #SE:").append(getSingleElectronCount());
     for (int i = 0; i < getSingleElectronCount(); i++) {
       stringContent.append(", ").append(getSingleElectron(i).toString());
     }
   }
   if (stereoElements.size() > 0) {
     stringContent.append(", ST:[#").append(stereoElements.size());
     for (IStereoElement elements : stereoElements) {
       stringContent.append(", ").append(elements.toString());
     }
     stringContent.append(']');
   }
   stringContent.append(')');
   return stringContent.toString();
 }