001/*
002 *                    PDB web development code
003 *
004 * This code may be freely distributed and modified under the
005 * terms of the GNU Lesser General Public Licence.  This should
006 * be distributed with the code.  If you do not have a copy,
007 * see:
008 *
009 *      http://www.gnu.org/copyleft/lesser.html
010 *
011 * Copyright for this code is held jointly by the individual
012 * authors.  These should be listed in @author doc comments.
013 *
014 *
015 * Created on May 23, 2009
016 * Created by Andreas Prlic
017 *
018 */
019
020package org.biojava.nbio.structure.align.helper;
021
022import java.io.Serializable;
023import java.util.Comparator;
024
025public class IdxComparator implements Comparator<int[]>, Serializable
026{
027        private static final long serialVersionUID = 1;
028
029        @Override
030        public int compare(int[] o1, int[] o2)
031        {
032                if (((o1[0]) == (o2[0])) &&
033                                ((o2[1]) == (o2[1])))
034                        return 0;
035                if ( o1[0] < o2[0])
036                        return -1;
037
038                return 1;
039        }
040
041}