Java Pneumatics

I was told this year I have to program our compressor and Solenoid for our robotic arm. I only programmed ROBOTC for FTC before. We have nobody experienced in Java and while we have a drive program I can’t for the life of me find out how to program pneumatics. Can anybody help me out even if its a little?

(This is my first post, sorry if its done wrong)

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.

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.

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.

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.

My double and single solenoid class

package com.shadowh511.mayor.outputs;

import edu.wpi.first.wpilibj.Solenoid;

/**
 *
 * @author sam
 */
public class MySolenoid {
    private Solenoid foo;
    private Solenoid bar;

    private boolean doublek = false;

    /*
     * For a one-solenoid system
     */
    public MySolenoid(int port) {
        foo = new Solenoid(8, port);
        doublek = false;
        System.out.println("MySolenoid enabled on port " + port);
    }

    /*
     * For a double solenoid system
     */
    public MySolenoid(int port1, int port2) {
        doublek = true;
        foo = new Solenoid(8, port1);
        bar = new Solenoid(8, port2);
        System.out.println("Double MySolenoid enabled on ports " + port1 + " and " + port2);
    }

    /*
     * For a double solenoid system, custom slot
     */
    public MySolenoid(int slot, int port1, int port2) {
        doublek = true;
        foo = new Solenoid(slot, port1);
        bar = new Solenoid(slot, port2);
        System.out.println("Double MySolenoid enabled on slot " + slot + " and ports " + port1 + " and " + port2);
    }

    /*
     * Extends the solenoid
     */
    public void extend() {
        foo.set(true);

        if(doublek) {
            bar.set(false);
        }
    }

    /*
     * Retracts the solenoid
     */
    public void retract() {
        foo.set(false);

        if(doublek) {
            bar.set(true);
        }
    }

    /*
     * Gets the state of the first solenoid
     */
    public boolean get() {
        return this.foo.get();
    }

    /*
     * Gets the state of the other solenoid
     */
    public boolean getOther() {
        boolean eggs = bar.get();
        return eggs;
    }
}

Thank you! Those both were very helpful!!!