
dcutils.cards.standard.Rank Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of dcutils Show documentation
Show all versions of dcutils Show documentation
Contains convenience classes for: tuples, ranges, graphs, etc.
package dcutils.cards.standard;
// Import JDK Classes
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
/**
* Represents all the ranks in the standard deck of playing cards.
* @author dca
*/
public enum Rank implements Iterable {
ACE("ace"),
DEUCE("deuce"),
THREE("three"),
FOUR("four"),
FIVE("five"),
SIX("six"),
SEVEN("seven"),
EIGHT("eight"),
NINE("nine"),
TEN("ten"),
JACK("jack"),
QUEEN("queen"),
KING("king");
private String name;
private Rank(String name) {
this.name = name;
} // END constructor
public String getName() {
return this.name;
} // END getName
public static Rank[] asArray() {
return values();
} // END asArray
public static List asList() {
return Arrays.asList(asArray());
} // END asList
@Override
public Iterator iterator() {
return asList().iterator();
} // END iterator
@Override
public String toString() {
return getName();
} // END toString
} // END enum Rank
© 2015 - 2025 Weber Informatics LLC | Privacy Policy