src/PokerHand.java
public int hasStraight() {
		LinkNode<Card> ref = head;
		// Check if the first card is Two and the last card is Ace
		if (head.getData().getRank().getValue() == 2
				&& head.getNext().getNext().getNext().getNext().getData().getRank().getValue() == 14) {
			// Check if the following cards follows
			while (ref.getNext().getNext() != null) {
				if (ref.getData().compareRank(ref.getNext().getData()) != -1)
					return 0;
				ref = ref.getNext();
			}
			return 5;
		}

		// Regular cases
		ref = head;
		while (ref.getNext() != null) {
			if (ref.getData().compareRank(ref.getNext().getData()) != -1)
				return 0;
			ref = ref.getNext();
		}
		return ref.getData().getRank().getValue();
	}
// HasStraight method returns the largest rank in the straight
HasStraight method returns the largest rank in the straight
HasStraight method returns the largest rank in the straight
public int hasStraight() {
		LinkNode<Card> ref = head;
		if (head.getData().getRank().getValue() == 2
				&& head.getNext().getNext().getNext().getNext().getData().getRank().getValue() == 14) {
			while (ref.getNext().getNext() != null) {
				if (ref.getData().compareRank(ref.getNext().getData()) != -1)
					return 0;
				ref = ref.getNext();
			}
			return 5;
		}
		ref = head;
		while (ref.getNext() != null) {
			if (ref.getData().compareRank(ref.getNext().getData()) != -1)
				return 0;
			ref = ref.getNext();
		}
		return ref.getData().getRank().getValue();
	}
public int hasStraight ( ) { LinkNode < Card > ref = head ; if ( head . getData ( ) . getRank ( ) . getValue ( ) == 2 && head . getNext ( ) . getNext ( ) . getNext ( ) . getNext ( ) . getData ( ) . getRank ( ) . getValue ( ) == 14 ) { while ( ref . getNext ( ) . getNext ( ) != null ) { if ( ref . getData ( ) . compareRank ( ref . getNext ( ) . getData ( ) ) != - 1 ) return 0 ; ref = ref . getNext ( ) ; } return 5 ; } ref = head ; while ( ref . getNext ( ) != null ) { if ( ref . getData ( ) . compareRank ( ref . getNext ( ) . getData ( ) ) != - 1 ) return 0 ; ref = ref . getNext ( ) ; } return ref . getData ( ) . getRank ( ) . getValue ( ) ; }
HasStraight method returns the largest rank in the straight
HasStraight method returns the largest rank in the straight
// Check if the first card is Two and the last card is Ace // Check if the following cards follows // Regular cases