What Java method takes an int and returns +1 or -1? The criteria for this is whether or not the int is positive or negative. I looked through the docum
int
Math.signum(value) will do the trick but since it returns float or double (according to parameter) you will have to cast it:
Math.signum(value)
int sign = (int)Math.signum(value);
or:
Integer.signum(value);