Java Version of the "Power" class for MatLab