There is a compressor method that handles the relay for you.
Code:
Compressor(int pressureSwitchChannel, int compressorRelayChannel)
is the constructor for a Compressor. It reads the pressure switch and handles the compressor relay.
Code:
Compressor compressor = new Compressor(1,1);
...
compressor.start();
is enough to get the compressor started. It will automatically be stopped when the pressure switch tells it to.