Java, Multiple classes and their multiple booleans
<p>So I've been stuck on this issue for quite some time now and I just can't seem to figure out the solution. I'm currently working on a project that simulates a parking garage.  The parking garage itself isn't the issue; it's the several types of customers that are supposed to be simulated. To make things a little easier I'll ask for the solution of one and with that I should be able to work out the others myself.
For starters it is a requirement to create a separate class for customers with a parking pass and integrate this in a way that shows which cars are parking pass holders and which aren't.</p>

<pre><code>import java.util.Random;

/* creates a boolean called isPass that is randomly picked to be true or false. */
public interface ParkPass {

    public Random rnd = new Random();

    public boolean isPass = rnd.nextBoolean();
}
</code></pre>

<p>This is the class that allows me to randomly set a parking pass.  Since the simulation happens through a different class, all I can do is create the method to set the Pass to true or false; I can't set the Pass itself in this class.</p>

<pre><code>public abstract class Car {

    private Location location;
    private int minutesLeft;
    public boolean isPaying;
    public boolean isBlue;


    public void setIsPaying(boolean isPaying) {
        this.isPaying = isPaying;
    }
    // added a method to allow us to set the colour of the car to blue for when they have a parking pass.
    public void setIsBlue(boolean isBlue) {
        this.isBlue = isBlue;
    }
</code></pre>

<p>This is a small snippet of the Car class that shows which booleans belong to it and might show you which direction I'm trying to go with this simulation.</p>

<pre><code>public class AdHocCar extends Car implements ParkPass{

    public AdHocCar() {
        setIsBlue(isPass);
        setIsPaying(!isPass);
    }
}    
</code></pre>

<p>This is the class that is called when simulating a car going in and out of the parking garage. Here you can see I tried implementing the ParkPass class in order to set the Isblue and IsPaying booleans in the Car class so that I can call upon these in the next bit of code which is the simulation view that I'm currently stuck on trying to fix.</p>

<pre><code>import javax.swing.*;
import java.awt.*;

public class SimulatorView extends JFrame {
    private CarParkView carParkView;
    private int numberOfFloors;
    private int numberOfRows;
    private int numberOfPlaces;
    private Car[][][] cars;

        public void updateView() {
            /* Create a new car park image if the size has changed.
               added 2 colours to show the difference between the three different customer types.*/
            if (!size.equals(getSize())) {
                size = getSize();
                carParkImage = createImage(size.width, size.height);
            }
            Graphics graphics = carParkImage.getGraphics();
            for(int floor = 0; floor &lt; getNumberOfFloors(); floor++) {
                for(int row = 0; row &lt; getNumberOfRows(); row++) {
                    for(int place = 0; place &lt; getNumberOfPlaces(); place++) {
                        Location location = new Location(floor, row, place);
                        Car car = getCarAt(location);
                        Color color = car == null ? Color.white : Car.isBlue ? Color.blue /*: isReservation == true ? Color.green*/ :Color.red ;
                        drawPlace(graphics, location, color);
                    }
                }
            }
           repaint();
        }
</code></pre>



<p>And here we finally get to the problem I have been facing. If you look at it right now you'll probably notice quite a few things wrong.  This is because after 10 hours of research and constant changing of the Color attribute I kind of lost track of the exact way I was trying to implement the booleans that were created earlier in order to show the difference between the two types of customer. I'm not extremely experienced with programming so after awhile I just gave in and decided to ask here.</p>

<p>Now for the question, with all these separate classes creating their own booleans how can I make sure that when I use the simulation the cars using a Parking Pass will be blue while the cars that have to pay normally are shown as red?</p>