// Path: src/main/java/org/poker/api/core/Card.java
// @Immutable
// public final class Card {
// 
//     private static final String STRING_RANK_CARDS = "23456789TJQKA";
// 
//     public enum Suit {
// 
//         SPADE('♠'), HEART('♥'), DIAMOND('♦'), CLUB('♣');
//         
//         private final char c;
// 
//         private Suit(char c) {
//             this.c = c;
//         }
// 
//     }
// 
//     public enum Rank {
// 
//         TWO, TRHEE, FOUR, FIVE, SIX, SEVEN, EIGHT, NINE, TEN, JACK, QUEEN, KING, ACE
//     }
// 
//     private final Suit suit;
//     private final Rank rank;
// 
//     public Card(Suit suit, Rank rank) {
//         ExceptionUtil.checkNullArgument(rank, "rank");
//         ExceptionUtil.checkNullArgument(suit, "suit");
//         this.suit = suit;
//         this.rank = rank;
//     }
// 
//     public Suit getSuit() {
//         return suit;
//     }
// 
//     public Rank getRank() {
//         return rank;
//     }
// 
//     @Override
//     public int hashCode() {
//         return rank.ordinal() * Suit.values().length + suit.ordinal();
//     }
// 
//     @Override
//     public boolean equals(Object obj) {
//         boolean result = true;
//         if (this != obj) {
//             result = false;
//             if (obj != null && getClass() == obj.getClass()) {
//                 result = hashCode() == ((Card) obj).hashCode();
//             }
//         }
//         return result;
//     }
// 
//     @Override
//     public String toString() {
//         return STRING_RANK_CARDS.substring(rank.ordinal(), rank.ordinal() + 1) + suit.c;
//     }
// }
// 
// Path: src/main/java/org/poker/api/core/IHandEvaluator.java
// @FunctionalInterface
// public interface IHandEvaluator {
// 
//     public int eval(Card[] cards);
// }
// 
// Path: src/main/java/org/poker/api/game/TexasHoldEmUtil.java
// public static final int COMMUNITY_CARDS = 5;
// 
// Path: src/main/java/org/poker/api/game/TexasHoldEmUtil.java
// public static final int PLAYER_CARDS = 2;
// 
// Path: src/main/java/org/util/combinatorial/Combination.java
// @NotThreadSafe
// public class Combination implements ICombinatorial {
// 
//     private final int items;
//     private final int[] indexes;
// 
//     public Combination(int subItems, int items) {
//         ExceptionUtil.checkMinValueArgument(subItems, 1, "subItems");
//         ExceptionUtil.checkMinValueArgument(items, subItems, "items");
//         this.indexes = new int[subItems];
//         this.items = items;
//         init();
//     }
// 
//     @Override
//     public long combinations() {
//         return combinations(indexes.length, items);
//     }
// 
//     @Override
//     public int size() {
//         return indexes.length;
//     }
// 
//     public int getSubItems() {
//         return indexes.length;
//     }
// 
//     public int getItems() {
//         return items;
//     }
// 
//     private boolean hasNext(int index) {
//         return indexes[index] + (indexes.length - index) < items;
//     }
// 
//     private void move(int index) {
//         if (hasNext(index)) {
//             indexes[index]++;
//             int last = indexes[index];
//             for (int i = index + 1; i < indexes.length; i++) {
//                 this.indexes[i] = ++last;
//             }
//         } else {
//             move(index - 1);
//         }
//     }
// 
//     @Override
//     public int[] next(int[] items) {
//         if (hasNext()) {
//             move(indexes.length - 1);
//             System.arraycopy(indexes, 0, items, 0, indexes.length);
//         }
//         return items;
//     }
// 
//     @Override
//     public boolean hasNext() {
//         return hasNext(0) || hasNext(indexes.length - 1);
//     }
// 
//     private void init() {
//         int index = indexes.length;
//         for (int i = 0; i < indexes.length; i++) {
//             this.indexes[i] = i;
//         }
//         this.indexes[index - 1]--;
//     }
// 
//     @Override
//     public void clear() {
//         init();
//     }
// 
//     public static long combinations(int subItems, int items) {
//         long result = 1;
//         int sub = Math.max(subItems, items - subItems);
//         for (int i = sub + 1; i <= items; i++) {
//             result = (result * i) / (i - sub);
//         }
//         return result;
//     }
// }


import java.util.List;
import net.jcip.annotations.NotThreadSafe;
import org.poker.api.core.Card;
import org.poker.api.core.IHandEvaluator;
import static org.poker.api.game.TexasHoldEmUtil.COMMUNITY_CARDS;
import static org.poker.api.game.TexasHoldEmUtil.PLAYER_CARDS;
import org.util.combinatorial.Combination;
/* 
 * Copyright (C) 2016 David Pérez Cabrera <dperezcabrera@gmail.com>
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
package org.poker.api.game;


/**
 *
 * @author David Pérez Cabrera <dperezcabrera@gmail.com>
 * @since 1.0.0
 * 
 */
@NotThreadSafe
public class Hand7Evaluator {

    public static final int TOTAL_CARDS = PLAYER_CARDS + COMMUNITY_CARDS;
    private final int[] combinatorialBuffer = new int[COMMUNITY_CARDS];
// Path: src/main/java/org/poker/api/core/Card.java
// @Immutable
// public final class Card {
// 
//     private static final String STRING_RANK_CARDS = "23456789TJQKA";
// 
//     public enum Suit {
// 
//         SPADE('♠'), HEART('♥'), DIAMOND('♦'), CLUB('♣');
//         
//         private final char c;
// 
//         private Suit(char c) {
//             this.c = c;
//         }
// 
//     }
// 
//     public enum Rank {
// 
//         TWO, TRHEE, FOUR, FIVE, SIX, SEVEN, EIGHT, NINE, TEN, JACK, QUEEN, KING, ACE
//     }
// 
//     private final Suit suit;
//     private final Rank rank;
// 
//     public Card(Suit suit, Rank rank) {
//         ExceptionUtil.checkNullArgument(rank, "rank");
//         ExceptionUtil.checkNullArgument(suit, "suit");
//         this.suit = suit;
//         this.rank = rank;
//     }
// 
//     public Suit getSuit() {
//         return suit;
//     }
// 
//     public Rank getRank() {
//         return rank;
//     }
// 
//     @Override
//     public int hashCode() {
//         return rank.ordinal() * Suit.values().length + suit.ordinal();
//     }
// 
//     @Override
//     public boolean equals(Object obj) {
//         boolean result = true;
//         if (this != obj) {
//             result = false;
//             if (obj != null && getClass() == obj.getClass()) {
//                 result = hashCode() == ((Card) obj).hashCode();
//             }
//         }
//         return result;
//     }
// 
//     @Override
//     public String toString() {
//         return STRING_RANK_CARDS.substring(rank.ordinal(), rank.ordinal() + 1) + suit.c;
//     }
// }
// 
// Path: src/main/java/org/poker/api/core/IHandEvaluator.java
// @FunctionalInterface
// public interface IHandEvaluator {
// 
//     public int eval(Card[] cards);
// }
// 
// Path: src/main/java/org/poker/api/game/TexasHoldEmUtil.java
// public static final int COMMUNITY_CARDS = 5;
// 
// Path: src/main/java/org/poker/api/game/TexasHoldEmUtil.java
// public static final int PLAYER_CARDS = 2;
// 
// Path: src/main/java/org/util/combinatorial/Combination.java
// @NotThreadSafe
// public class Combination implements ICombinatorial {
// 
//     private final int items;
//     private final int[] indexes;
// 
//     public Combination(int subItems, int items) {
//         ExceptionUtil.checkMinValueArgument(subItems, 1, "subItems");
//         ExceptionUtil.checkMinValueArgument(items, subItems, "items");
//         this.indexes = new int[subItems];
//         this.items = items;
//         init();
//     }
// 
//     @Override
//     public long combinations() {
//         return combinations(indexes.length, items);
//     }
// 
//     @Override
//     public int size() {
//         return indexes.length;
//     }
// 
//     public int getSubItems() {
//         return indexes.length;
//     }
// 
//     public int getItems() {
//         return items;
//     }
// 
//     private boolean hasNext(int index) {
//         return indexes[index] + (indexes.length - index) < items;
//     }
// 
//     private void move(int index) {
//         if (hasNext(index)) {
//             indexes[index]++;
//             int last = indexes[index];
//             for (int i = index + 1; i < indexes.length; i++) {
//                 this.indexes[i] = ++last;
//             }
//         } else {
//             move(index - 1);
//         }
//     }
// 
//     @Override
//     public int[] next(int[] items) {
//         if (hasNext()) {
//             move(indexes.length - 1);
//             System.arraycopy(indexes, 0, items, 0, indexes.length);
//         }
//         return items;
//     }
// 
//     @Override
//     public boolean hasNext() {
//         return hasNext(0) || hasNext(indexes.length - 1);
//     }
// 
//     private void init() {
//         int index = indexes.length;
//         for (int i = 0; i < indexes.length; i++) {
//             this.indexes[i] = i;
//         }
//         this.indexes[index - 1]--;
//     }
// 
//     @Override
//     public void clear() {
//         init();
//     }
// 
//     public static long combinations(int subItems, int items) {
//         long result = 1;
//         int sub = Math.max(subItems, items - subItems);
//         for (int i = sub + 1; i <= items; i++) {
//             result = (result * i) / (i - sub);
//         }
//         return result;
//     }
// }


// Path: src/main/java/org/poker/api/game/Hand7Evaluator.java
import java.util.List;
import net.jcip.annotations.NotThreadSafe;
import org.poker.api.core.Card;
import org.poker.api.core.IHandEvaluator;
import static org.poker.api.game.TexasHoldEmUtil.COMMUNITY_CARDS;
import static org.poker.api.game.TexasHoldEmUtil.PLAYER_CARDS;
import org.util.combinatorial.Combination;

/* 
 * Copyright (C) 2016 David Pérez Cabrera <dperezcabrera@gmail.com>
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
package org.poker.api.game;


/**
 *
 * @author David Pérez Cabrera <dperezcabrera@gmail.com>
 * @since 1.0.0
 * 
 */
@NotThreadSafe
public class Hand7Evaluator {

    public static final int TOTAL_CARDS = PLAYER_CARDS + COMMUNITY_CARDS;
    private final int[] combinatorialBuffer = new int[COMMUNITY_CARDS];
    private final Combination combinatorial = new Combination(COMMUNITY_CARDS, TOTAL_CARDS);