-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSuits.java
More file actions
40 lines (35 loc) · 788 Bytes
/
Suits.java
File metadata and controls
40 lines (35 loc) · 788 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/**
* An enum representing the suits in a normal poker deck
*
* @author paw: AUTHOR_FULL_NAME_HERE
*/
public enum Suits {
CLUBS('C'),
DIAMONDS('D'),
HEARTS('H'),
SPADES('S');
/**
* a constant for the total number of suits
*/
public static final int NUM_SUITS = 4;
/**
* the short name for the suit, e.g. 'H' for hearts
*/
private final char shortName;
/**
* initialize the suit enums,
*
* @param name short name for the suit
*/
Suits(char name) {
this.shortName = name;
}
/**
* accessor for the name
*
* @return a char with the short name for this suit
*/
public char getShortName() {
return shortName;
}
}