public static void sort ( IRingSet ringSet ) { List < IRing > ringList = new ArrayList < IRing > ( ) ; for ( IAtomContainer atomContainer : ringSet . atomContainers ( ) ) { ringList . add ( ( IRing ) atomContainer ) ; } Collections . sort ( ringList , new RingSizeComparator ( RingSizeComparator . SMALL_FIRST ) ) ; ringSet . removeAllAtomContainers ( ) ; for ( IAtomContainer aRingList : ringList ) ringSet . addAtomContainer ( aRingList ) ; }
Sorts the rings in the set by size . The smallest ring comes first .