I'm new to java and for university i have to program a LEGO nxt robot.
I need to read a rotationsensor's value and set it to a motorcommand.
in the class RCXRotatingSensor, there are the following methods:

protected int getPhase() //Returns the current phase of the sensor.
int getRawTachoCount() //Returns the raw values from the rotation sensor instead of degrees.
int getRotationSpeed() //Returns the actual speed.
int getTachoCount() //Returns the tachometer count.
void resetTachoCount() //Reset the tacho count to zero.
leJOS api can be found here: leJOS NXJ API documentation

My thought:
public void rotateMotor(){
while( getRotationSpeed()>0){
if (turnsLeft==true){
Motor.A.forward();
}
else Motor.A.backward();
}//end while
} end method

The problem is, that i don't know how to create the method turnsLeft()
it should be something like:

public boolean turnsLeft(){
RCXRotationSensor r =new RCXRotationSensor(SensorPort.S1)
int value1=r.getRawTachoCount();
while (getRawTachocount()=value2==value1){ //not sure if this line works
//do nothing, stay in this loop
}//end while

if(value2<value1){
return true;
}

else return false;
} //end method turnsLeft

but i think this isn't the best method...
I hope you can help me
Reinout