Class IntegerHistogram


  • public class IntegerHistogram
    extends java.lang.Object
    IntegerHistogram

    Copyright: Actelion Ltd., Inc. All Rights Reserved This software is the proprietary information of Actelion Pharmaceuticals, Ltd. Use is subject to license terms.

    Version:
    1.0 Jun 11, 2013 MvK Start implementation Nov 6, 2014 MvK getBinsEquallyDistributed(...) adapted for the case that the range is below the number of bins. Jun 09, 2016 improved formatting in toString() method.
    Author:
    Modest von Korff
    • Field Detail

      • ARR_BINS_EXAMPLE

        public static final int[][] ARR_BINS_EXAMPLE
    • Constructor Detail

      • IntegerHistogram

        public IntegerHistogram​(int[][] arrBins)
      • IntegerHistogram

        public IntegerHistogram​(int[][] arrBins,
                                boolean consecutive)
    • Method Detail

      • add

        public void add​(int v)
        Added to the bin where fullfilling the criteria v >= lower bound and v < higher bound.
        Parameters:
        v -
      • add

        public void add​(int[] a)
      • add

        public void add​(java.util.List<java.lang.Integer> li)
      • getTotalCounts

        public int getTotalCounts()
      • getBinWithNPercentOfAllCounts

        public int[] getBinWithNPercentOfAllCounts​(int percent)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • main

        public static void main​(java.lang.String[] args)
      • getBinsEquallyDistributed

        public static int[][] getBinsEquallyDistributed​(int bins,
                                                        int maxValue)
      • getBinsEquallyDistributed

        public static int[][] getBinsEquallyDistributed​(int bins,
                                                        int minValue,
                                                        int maxValue)