Collections Sorting in Java -
What's wrong in this way? It does not work properly.
Public listing & lt; LibRegistration & gt; GetLibraryRegistrationsSortedByTypeAndName () {List & lt; LibRegistration & gt; L = getLibRegs (); Collections (L., New Comparative () {Comparison of Public Entry (Librizistration O1, Libertarian O2) {Return O 1. Get Library Type (.) Compare (o 2.Gate Library Type ())! = 0? O1.getLibraryType () CompareTo (o2.getLibraryType ()): o1.getLibraryName (). Compare (o2.getLibraryName ());}}); Returns L; }
Nothing wrong, more obvious:
Comparison of public entities (LibreOfficiency O1, LibreOfficiency O2) {int CMP = o 1. Great Library type (). Compare (O 2. Gallet Library Type ()); If (cmp == 0) cmp = o1.getLibraryName (). Compare (o2.getLibraryName ()); Return cmp; } Although the nose is not allowed and well defined,
Comments
Post a Comment