Package com.poker.analyst.analyser.combanalyzer

Source Code of com.poker.analyst.analyser.combanalyzer.TwoPairAnalyzer

package com.poker.analyst.analyser.combanalyzer;

import java.util.ArrayList;
import java.util.List;

import com.poker.analyst.combination.Flush;
import com.poker.analyst.combination.Pair;
import com.poker.analyst.combination.Straight;
import com.poker.analyst.combination.StraightFlush;
import com.poker.analyst.combination.TwoPairs;
import com.poker.analyst.element.Card;

public class TwoPairAnalyzer
  public static List<TwoPairs> analyseTwoPairs(List<Pair> pairs){
    List<TwoPairs>   twoPairsList = null;
    TwoPairs       twoPairs = null;
    List<Card>    cardList = null
   
    if (pairs == null || pairs.size() < 2)
      return null
   
    twoPairsList = new ArrayList<TwoPairs>();
   
   
    for (int i = 0; i< pairs.size(); i++){
      for (int j = i+1; j< pairs.size(); j++){
        cardList = new ArrayList<Card>();
        cardList.addAll(pairs.get(i).getCombinationList());
        cardList.addAll(pairs.get(j).getCombinationList());
        twoPairs = new TwoPairs()
        twoPairs.setCombinationList(cardList);
        twoPairsList.add(twoPairs);
     
    }
   
   
   
   
       
    return twoPairsList;
  }
}
TOP

Related Classes of com.poker.analyst.analyser.combanalyzer.TwoPairAnalyzer

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.