import com.poker.analyst.element.Card;
public class StraightFlushAnalyzer {
public static List<StraightFlush> analyseStraightFlush(List<Flush> flushs, List<Straight> straights){
List<StraightFlush> straightFlushList = null;
StraightFlush straightFlush = null;
if (flushs == null || straights == null)
return null;
boolean equals;
for (Flush flush: flushs){
for (Straight straight: straights){
equals = true;
for(int i = 0; i< flush.getCombinationList().size(); i++){
if (!flush.getCombinationList().get(i).getFace().equals(
straight.getCombinationList().get(i).getFace())){
equals = false;
break;
}
}
if (equals){
straightFlush = new StraightFlush();
straightFlush.setCombinationList(flush.getCombinationList());
if (straightFlushList == null)
straightFlushList = new ArrayList<StraightFlush>();
straightFlushList.add(straightFlush);