Recall that Math.abs will give you the absolute value.
Math.abs
The method for getting the sign of a value is Integer.signum.