Class IntegerComparator
- java.lang.Object
-
- psidev.psi.mi.jami.utils.comparator.IntegerComparator
-
- All Implemented Interfaces:
Comparator<Integer>
public class IntegerComparator extends Object implements Comparator<Integer>
Comparator for comparing integers. By default, it will sort integers ascending but it can be changed by setting property boolean ascending to false;- Since:
30/01/14
- Version:
- $Id$
- Author:
- Marine Dumousseau (marine@ebi.ac.uk)
-
-
Constructor Summary
Constructors Constructor Description IntegerComparator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompare(Integer integer, Integer integer2)comparebooleanisAscending()isAscendingvoidsetAscending(boolean ascending)Setter for the fieldascending.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
-
-
-
Method Detail
-
compare
public int compare(Integer integer, Integer integer2)
compare
- Specified by:
comparein interfaceComparator<Integer>- Parameters:
integer- aIntegerobject.integer2- aIntegerobject.- Returns:
- a int.
-
isAscending
public boolean isAscending()
isAscending
- Returns:
- a boolean.
-
setAscending
public void setAscending(boolean ascending)
Setter for the field
ascending.- Parameters:
ascending- a boolean.
-
-