/// <summary> Returns all the AtomContainer's of a ChemSequence.</summary> public static IAtomContainer[] getAllAtomContainers(IChemSequence sequence) { IChemModel[] models = sequence.ChemModels; int acCount = 0; System.Collections.ArrayList acArrays = System.Collections.ArrayList.Synchronized(new System.Collections.ArrayList(10)); for (int i = 0; i < models.Length; i++) { IAtomContainer[] modelContainers = ChemModelManipulator.getAllAtomContainers(models[i]); acArrays.Add(modelContainers); acCount += modelContainers.Length; } IAtomContainer[] containers = new IAtomContainer[acCount]; int arrayOffset = 0; //UPGRADE_TODO: Method 'java.util.Enumeration.hasMoreElements' was converted to 'System.Collections.IEnumerator.MoveNext' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javautilEnumerationhasMoreElements'" for (System.Collections.IEnumerator acArraysElements = acArrays.GetEnumerator(); acArraysElements.MoveNext();) { //UPGRADE_TODO: Method 'java.util.Enumeration.nextElement' was converted to 'System.Collections.IEnumerator.Current' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javautilEnumerationnextElement'" IAtomContainer[] modelContainers = (IAtomContainer[])acArraysElements.Current; Array.Copy(modelContainers, 0, containers, arrayOffset, modelContainers.Length); arrayOffset += modelContainers.Length; } return(containers); }
public static int getBondCount(IChemSequence sequence) { int count = 0; for (int i = 0; i < sequence.ChemModelCount; i++) { count += ChemModelManipulator.getBondCount(sequence.getChemModel(i)); } return(count); }
public static System.Collections.IList getAllChemObjects(IChemSequence sequence) { System.Collections.ArrayList list = new System.Collections.ArrayList(); list.Add(sequence); for (int i = 0; i < sequence.ChemModelCount; i++) { list.AddRange(ChemModelManipulator.getAllChemObjects(sequence.getChemModel(i))); } return(list); }
/// <summary> Puts all the Molecules of this container together in one /// AtomCcntainer. /// /// </summary> /// <returns> The AtomContainer with all the Molecules of this container /// /// </returns> /// <deprecated> This method has a serious performace impact. Try to use /// other methods. /// </deprecated> public static IAtomContainer getAllInOneContainer(IChemSequence sequence) { IAtomContainer container = sequence.Builder.newAtomContainer(); for (int i = 0; i < sequence.ChemModelCount; i++) { IChemModel model = sequence.getChemModel(i); container.add(ChemModelManipulator.getAllInOneContainer(model)); } return(container); }