// java.util.Arrays enables use of sorting algorithms built into Java
// java.util.Collections enables sorting to happen in descending order
import java.util.Arrays;
import java.util.Collections;

public class Hand {
	private Card[] cards;

	public Hand(Card[] cards) {
		Arrays.sort(cards, Collections.reverseOrder());  // high to low
		this.cards = cards;
	}

	public String getPokerValue() {
		if (isRoyalFlush()) {
			return "Royal Flush";
		} else if (isStraightFlush()) {
			return "Straight Flush";
		} else if (isQuads()) {
			return "Quads";
		} else if (isFullHouse()) {
			return "Full House";
		} else if (isFlush()) {
			return "Flush";
		} else if (isStraight()) {
			return "Straight";
		} else if (isThreeOfAKind()) {
			return "Trips";
		} else if (isTwoPair()) {
			return "Two Pair";
		} else if (isPair()) {
			return "Pair";
		}
		
		return "Garbage";
	}

	// Write isRoyalFlush() and isStraightFlush() after isFlush() and isStraight()
	private boolean isRoyalFlush() {
		// TODO Auto-generated method stub
		return false;
	}

	private boolean isStraightFlush() {
		// TODO Auto-generated method stub
		return false;
	}

	private boolean isQuads() {
		// TODO Auto-generated method stub
		return false;
	}

	private boolean isFullHouse() {
		// TODO Auto-generated method stub
		return false;
	}

	private boolean isThreeOfAKind() {
		// TODO Auto-generated method stub
		return false;
	}

	public boolean isTwoPair() {
		// TODO Auto-generated method stub
		return false;
	}

	public boolean isPair() {
		// TODO Auto-generated method stub
		return false;
	}

	public boolean isFlush() {
		// TODO Auto-generated method stub
		return false;
	}

	public boolean isStraight() {
		// The first comparison needs to be between cards[0] and cards[1],
		// and the last comparison needs to be between cards[3] and cards[4].
		// i therefore starts at 0 and goes up to 3 
		return false;
	}

	public String toString() {
		String returnString = "";
		returnString += "{";
		for (int i = 0; i < cards.length; i++) {
			returnString += cards[i];
			if (i < cards.length-1) {
				returnString += ", ";
			}
		}
		returnString += "}";
		return returnString;
	}

}