@@ -0,0 +1,1606 @@
+/*%0D%0A * Licensed to the Apache Software Foundation (ASF) under one or more%0D%0A * contributor license agreements.  See the NOTICE file distributed with%0D%0A * this work for additional information regarding copyright ownership.%0D%0A * The ASF licenses this file to You under the Apache License, Version 2.0%0D%0A * (the %22License%22); you may not use this file except in compliance with%0D%0A * the License.  You may obtain a copy of the License at%0D%0A *%0D%0A *      http://www.apache.org/licenses/LICENSE-2.0%0D%0A *%0D%0A * Unless required by applicable law or agreed to in writing, software%0D%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0D%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0D%0A * See the License for the specific language governing permissions and%0D%0A * limitations under the License.%0D%0A */%0D%0A%0D%0A/* $Id: destinationComparator.java 426576 2006-07-28 15:44:37Z jeremias $ */%0D%0A%0D%0Apackage org.apache.fop.pdf;%0D%0A%0D%0Aimport org.apache.fop.pdf.PDFDestination;%0D%0A%0D%0A/**%0D%0A * Comparator class to enable comparing (and%0D%0A * hence sorting) of PDFDestination objects.%0D%0A */%0D%0Apublic class DestinationComparator implements java.util.Comparator %7B%0D%0A/*  public int compare (PDFDestination dest1, PDFDestination dest2) %7B%0D%0A    return dest1.getIDRef().compareTo(dest2.getIDRef());%0D%0A  %7D*/%0D%0A%0D%0A  public int compare (Object obj1, Object obj2) %7B%0D%0A    if (obj1 instanceof PDFDestination && obj2 instanceof PDFDestination)%7B%0D%0A      PDFDestination dest1 = (PDFDestination)obj1;%0D%0A      PDFDestination dest2 = (PDFDestination)obj2;%0D%0A      return dest1.getIDRef().compareTo(dest2.getIDRef());%0D%0A    %7D%0D%0A    return 0;%0D%0A  %7D%0D%0A%7D

Created a comparator for named destinations, to enable sorting the list of destinations.