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 int
compare(Integer integer, Integer integer2)
compareboolean
isAscending()
isAscendingvoid
setAscending(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:
compare
in interfaceComparator<Integer>
- Parameters:
integer
- aInteger
object.integer2
- aInteger
object.- 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.
-
-