Package de.alpharogroup.lottery.drawing
Class DrawnLotteryNumbersExtensions
- java.lang.Object
-
- de.alpharogroup.lottery.drawing.DrawnLotteryNumbersExtensions
-
public final class DrawnLotteryNumbersExtensions extends java.lang.ObjectThe classDrawnLotteryNumbersExtensionsprovides utility methods to draw lottery numbers with different algorithms
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.Set<java.lang.Integer>draw(int maxNumbers, int volume)Draw of lottery numbers.static java.util.Set<java.lang.Integer>draw(int maxNumbers, int minVolume, int maxVolume)Draw of lottery numbers.static java.util.Set<java.lang.Integer>drawDefaultAlgorithm(int maxNumbers, int minVolume, int maxVolume)This draw algorithm simulates the real world.static java.util.Set<java.lang.Integer>drawFromMultiMap(int maxNumbers, int minVolume, int maxVolume, int drawCount)Draw of lottery numbers from given drawCount and take the numbers that are drawn the most times and return a new set.static java.util.Set<java.lang.Integer>drawFromMultiMap(int maxNumbers, int minVolume, int maxVolume, int drawCount, boolean mostDrawn)Draw of lottery numbers from given drawCount and take the numbers that are drawn the most times and return a new set.static java.util.Set<java.lang.Integer>drawFromMultiMap(int maxNumbers, int minVolume, int maxVolume, int drawCount, boolean mostDrawn, boolean paranoid)Draw of lottery numbers from given drawCount and take the numbers that are drawn the most times and return a new set.static java.util.Comparator<java.lang.Integer>drawFromMultiMap(int maxNumbers, int minVolume, int maxVolume, int drawCount, boolean mostDrawn, boolean paranoid, java.util.Map<java.lang.Integer,java.lang.Integer> numberCounterMap)Factory method for create a comparator for sort the lottery numbersstatic intdrawGameSeventySeven()Draw the number of the game seventy sevenstatic java.util.Set<java.lang.Integer>drawParanoidFromMultiMap(int maxNumbers, int minVolume, int maxVolume, int drawCount)Draw of paranoid lottery numbers from given drawCount and take the numbers that are drawn the most times and return a new set.static intdrawSuperNumber(java.util.Set<java.lang.Integer> alreadyDrawnNumbers, int volume)Draws a super number that is not in the given already drawn numbersSet.static intdrawSuperNumber(java.util.Set<java.lang.Integer> alreadyDrawnNumbers, int minVolume, int maxVolume)Draws a super number that is not in the given already drawn numbersSet.static java.util.Set<java.lang.Integer>resolveLotteryNumbers(int maxNumbers, java.util.Comparator<java.lang.Integer> mostDrawn, java.util.Map<java.lang.Integer,java.lang.Integer> numberCounterMap)Resolves the lottery numbers from the given number counter map in the order from the given comparator limited to maxNumbers
-
-
-
Method Detail
-
draw
public static java.util.Set<java.lang.Integer> draw(int maxNumbers, int volume)Draw of lottery numbers.- Parameters:
maxNumbers- the max number to drawvolume- the volume of the numbers starts from 1 till volume- Returns:
- the sets the
-
draw
public static java.util.Set<java.lang.Integer> draw(int maxNumbers, int minVolume, int maxVolume)Draw of lottery numbers.- Parameters:
maxNumbers- the maximum of numbers to drawminVolume- the min volumemaxVolume- the max volume- Returns:
- the sets of the drawn numbers
-
drawDefaultAlgorithm
public static java.util.Set<java.lang.Integer> drawDefaultAlgorithm(int maxNumbers, int minVolume, int maxVolume)This draw algorithm simulates the real world.- Parameters:
maxNumbers- the max number to drawminVolume- the min volumemaxVolume- the volume of the numbers starts from 1 till volume- Returns:
- the sets the
-
drawFromMultiMap
public static java.util.Set<java.lang.Integer> drawFromMultiMap(int maxNumbers, int minVolume, int maxVolume, int drawCount)Draw of lottery numbers from given drawCount and take the numbers that are drawn the most times and return a new set.- Parameters:
maxNumbers- the maximum of numbers to drawminVolume- the min volumemaxVolume- the max volumedrawCount- the draw count defines how many times to draw numbers- Returns:
- the sets of the drawn numbers
-
drawFromMultiMap
public static java.util.Set<java.lang.Integer> drawFromMultiMap(int maxNumbers, int minVolume, int maxVolume, int drawCount, boolean mostDrawn)Draw of lottery numbers from given drawCount and take the numbers that are drawn the most times and return a new set.- Parameters:
maxNumbers- the maximum of numbers to drawminVolume- the min volumemaxVolume- the max volumedrawCount- the draw count defines how many times to draw numbersmostDrawn- the flag that indicates if the most drawn numbers should be taken if true, otherwise the reverse order will be taken- Returns:
- the sets of the drawn numbers
-
drawFromMultiMap
public static java.util.Set<java.lang.Integer> drawFromMultiMap(int maxNumbers, int minVolume, int maxVolume, int drawCount, boolean mostDrawn, boolean paranoid)Draw of lottery numbers from given drawCount and take the numbers that are drawn the most times and return a new set.- Parameters:
maxNumbers- the maximum of numbers to drawminVolume- the min volumemaxVolume- the max volumedrawCount- the draw count defines how many times to draw numbersmostDrawn- the flag that indicates if the most drawn numbers should be taken if true, otherwise the reverse order will be takenparanoid- the flag paranoid indicates to create a custom comparator from the counter map and define a random defined order to draw if true, otherwise the flag mostDrawn will define the order to draw- Returns:
- the sets of the drawn numbers
-
drawFromMultiMap
public static java.util.Comparator<java.lang.Integer> drawFromMultiMap(int maxNumbers, int minVolume, int maxVolume, int drawCount, boolean mostDrawn, boolean paranoid, java.util.Map<java.lang.Integer,java.lang.Integer> numberCounterMap)Factory method for create a comparator for sort the lottery numbers- Parameters:
maxNumbers- the maximum of numbers to drawminVolume- the min volumemaxVolume- the max volumedrawCount- the draw count defines how many times to draw numbersmostDrawn- the flag that indicates if the most drawn numbers should be taken if true, otherwise the reverse order will be takenparanoid- the flag paranoid indicates to create a custom comparator from the counter map and define a random defined order to draw if true, otherwise the flag mostDrawn will define the order to drawnumberCounterMap- the counter map for generate statistics of the drawn lottery numbers- Returns:
- the comparator for sort the lottery numbers
-
drawGameSeventySeven
public static int drawGameSeventySeven()
Draw the number of the game seventy seven- Returns:
- the drawn number of the game seventy seven
-
drawParanoidFromMultiMap
public static java.util.Set<java.lang.Integer> drawParanoidFromMultiMap(int maxNumbers, int minVolume, int maxVolume, int drawCount)Draw of paranoid lottery numbers from given drawCount and take the numbers that are drawn the most times and return a new set.- Parameters:
maxNumbers- the maximum of numbers to drawminVolume- the min volumemaxVolume- the max volumedrawCount- the draw count defines how many times to draw numbers- Returns:
- the sets of the drawn numbers
-
drawSuperNumber
public static int drawSuperNumber(java.util.Set<java.lang.Integer> alreadyDrawnNumbers, int volume)Draws a super number that is not in the given already drawn numbersSet.- Parameters:
alreadyDrawnNumbers- the already drawn numbersvolume- the volume of the numbers starts from 1 till volume- Returns:
- the drawn super number
-
drawSuperNumber
public static int drawSuperNumber(java.util.Set<java.lang.Integer> alreadyDrawnNumbers, int minVolume, int maxVolume)Draws a super number that is not in the given already drawn numbersSet.- Parameters:
alreadyDrawnNumbers- the already drawn numbersminVolume- the min volumemaxVolume- the max volume- Returns:
- the drawn super number
-
resolveLotteryNumbers
public static java.util.Set<java.lang.Integer> resolveLotteryNumbers(int maxNumbers, java.util.Comparator<java.lang.Integer> mostDrawn, java.util.Map<java.lang.Integer,java.lang.Integer> numberCounterMap)Resolves the lottery numbers from the given number counter map in the order from the given comparator limited to maxNumbers- Parameters:
maxNumbers- the max numbersmostDrawn- the comparator that defines in which order to take the drawn numbers. For instance if you want to have the reverse order you can simply give theComparator.reverseOrder()or you can define your custom ordernumberCounterMap- the number counter map- Returns:
- the sets of the lottery numbers
-
-