Class Quantize

java.lang.Object
org.eclipse.mat.query.quantize.Quantize

public final class Quantize extends Object
Create a value or frequency distribution out of arbitrary values.
  • Field Details

  • Method Details

    • valueDistribution

      public static Quantize.Builder valueDistribution(String... label)
      Creates a quantize Quantize.Builder for a value distribution, i.e. rows are grouped by identical values. Rows can be grouped by one ore more values.
      Parameters:
      label - multiple labels used to construct columns
      Returns:
      a Builder so that multiple construction options can be chained before calling Quantize.Builder.build()
    • valueDistribution

      public static Quantize.Builder valueDistribution(Column... column)
      Creates a quantize Quantize.Builder for a value distribution, i.e. rows are grouped by identical values. Rows can be grouped by one ore more values. This constructor uses the given columns and their formatting and alignment to display the results.
      Parameters:
      column - multiple columns, already with labels
      Returns:
      a Builder so that multiple construction options can be chained before calling Quantize.Builder.build()
    • linearFrequencyDistribution

      public static Quantize.Builder linearFrequencyDistribution(String label, double lowerBound, double upperBound, double step)
      Creates a quantize Quantize.Builder for a linear frequency distribution on double values.

      Basically, one can answer questions like how many collections have a fill ratio between 0 and 20%, between 20% and 40%, etc.

      Parameters:
      label - Name of the first column
      lowerBound - The lower bound of the distribution
      upperBound - The upper bound of the distribution
      step - The size of the buckets in the distribution
      Returns:
      a Builder so more options can be added before calling Quantize.Builder.build()
    • linearFrequencyDistribution

      public static Quantize.Builder linearFrequencyDistribution(String label, long lowerBound, long upperBound, long step)
      Creates a quantize Quantize.Builder for a linear frequency distribution on long values. linearFrequencyDistribution(String, double, double, double)
      Parameters:
      label - How to label this quantization
      lowerBound - the lowest long value
      upperBound - the highest long value
      step - the interval for each bucket between lowerBound and upperBound
      Returns:
      a Builder so that multiple construction options can be chained before calling Quantize.Builder.build()
    • addValue

      public void addValue(int objectId, Object... columnValues) throws SnapshotException
      Add one value to the quantize function representing one heap object.
      Parameters:
      objectId - the heap object represented by this value
      columnValues - the column values
      Throws:
      SnapshotException - if there is a problem, perhaps such as an invalid objectId
    • addValue

      public void addValue(int[] objectIds, Object... columnValues) throws SnapshotException
      Add one value to the quantize function representing a set of objects.
      Parameters:
      objectIds - the heap objects represented by this value
      columnValues - the column values
      Throws:
      SnapshotException - if there is a problem, perhaps such as an invalid objectId
    • getResult

      public IResult getResult()
      Returns the IResult build by the Quantize object.
      Returns:
      a Quantize.QuantizedResult