Java Enums

What is

Use Case Scenario

Casino Simulation Application

Deck Class

Card Class

Rank Class

public class  Rank {
    private final int primaryValue;
    private final String name;

    Rank(String name, int value) {
        this.name = name;
        this.value = value;
    }

    public String name() {
        return name;
    }

    public int getValue() {
        return value;
    }
}

Suit Class

public class Suit {
    private final boolean isRed;
    private final String color;

    Suit(String name, String color) {
        this.name = name;
        this.color = color;
    }

    public String name() {
        return this.name;
    }

    public String getColor() {
        return this.color;
    }
}

Design Implementations

Map Implementation

Public Static References

Enum Implementation