Here you can find the source of convertTimeToInt(long seconds)
Parameter | Description |
---|---|
seconds | Long value |
public static int convertTimeToInt(long seconds)
//package com.java2s; //License from project: Apache License public class Main { /**//w ww . j a v a 2s . com * Converts a long seconds value to an int seconds value and takes into account overflow * from the downcast by switching to Integer.MAX_VALUE. * @param seconds Long value * @return Same int value unless long > Integer.MAX_VALUE in which case MAX_VALUE is returned */ public static int convertTimeToInt(long seconds) { if (seconds > Integer.MAX_VALUE) { return Integer.MAX_VALUE; } else { return (int) seconds; } } }