For the Solenoids, the first thing to do is to create the Solenoid object. The constructor follows the general WPI format, with options to create it based on slot (of the Solenoid module) and channel, or just by channel.
Code:
Solenoid armSol = new Solenoid(7,4); //creates a Solenoid object in slot 7, channel 4.
After that, there are only two functions to concern yourself with: get(), which returns the current state of the Solenoid (true or false), and set(boolean on), which sets the state of the Solenoid.
Code:
armSol.set(true); //turns the Solenoid on
The compressor can take up to four parameters, because it has two 'things' to set: the location of the pressure switch (what reads the pressure and tells the robot when it's 'full'), and the location of the relay (what turns the compressor on or off). After that, start() the compressor object and it should automatically regulate itself, turning off when the pressure is high enough, then restarting when it drops. You can get the value of the pressure switch and the state of the compressor with getPressureSwitchValue() and enabled(), respectively, but for safety reasons you cannot control the actual state of the compressor manually.
Code:
Compressor aCompressor = new Compressor(1,1); //create a compressor with the default slots and relay and pressure switch channels 1 and 1.
aCompressor.start(); //start the compressor.