java.lang.Object
eu.steffo.cleaver.logic.utils.SafeLongToInt
public final class SafeLongToInt extends Object
-
Constructor Summary
Constructors Modifier Constructor Description private
SafeLongToInt()
Disallow instantiations of this class. -
Method Summary
Modifier and Type Method Description static int
longToInt(long l)
Cast a long to an int, returningInteger.MAX_VALUE
if the value of the long exceeds the value ofInteger.MAX_VALUE
,Integer.MIN_VALUE
if the value of the long is lower thanInteger.MIN_VALUE
and the result of the int cast otherwise.
-
Constructor Details
-
SafeLongToInt
private SafeLongToInt()Disallow instantiations of this class.
-
-
Method Details
-
longToInt
public static int longToInt(long l)Cast a long to an int, returningInteger.MAX_VALUE
if the value of the long exceeds the value ofInteger.MAX_VALUE
,Integer.MIN_VALUE
if the value of the long is lower thanInteger.MIN_VALUE
and the result of the int cast otherwise.- Parameters:
l
- The long to cast.- Returns:
- The casted int.
-