Package org.eclipse.mat.query.quantize
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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classQuantize.BuilderQuantizefactorystatic interfaceQuantize.FunctionA function used to aggregate values into one bucket, e.g.
-
Field Summary
Fields Modifier and Type Field Description static Quantize.Function.FactoryAVERAGEFunction to find the average value.static Quantize.Function.FactoryAVERAGE_BYTESFunction to find the average Bytes value.static Quantize.Function.FactoryAVERAGE_LONGFunction to find the average long value.static Quantize.Function.FactoryCOUNTFunction to count values.static Quantize.Function.FactoryMAXFunction to find the maximum double value.static Quantize.Function.FactoryMAX_BYTESFunction to find the maximum Bytes value.static Quantize.Function.FactoryMAX_LONGFunction to find the maximum long value.static Quantize.Function.FactoryMINFunction to find the minimum double value.static Quantize.Function.FactoryMIN_BYTESFunction to find the minimum Bytes value.static Quantize.Function.FactoryMIN_LONGFunction to find the minimum long value.static Quantize.Function.FactorySUMFunction to add values as doubles.static Quantize.Function.FactorySUM_BYTESFunction to add values as Bytes.static Quantize.Function.FactorySUM_LONGFunction to add values as longs.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddValue(int[] objectIds, Object... columnValues)Add one value to the quantize function representing a set of objects.voidaddValue(int objectId, Object... columnValues)Add one value to the quantize function representing one heap object.IResultgetResult()Returns theIResultbuild by the Quantize object.static Quantize.BuilderlinearFrequencyDistribution(String label, double lowerBound, double upperBound, double step)Creates a quantizeQuantize.Builderfor a linear frequency distribution on double values.static Quantize.BuilderlinearFrequencyDistribution(String label, long lowerBound, long upperBound, long step)Creates a quantizeQuantize.Builderfor a linear frequency distribution on long values.static Quantize.BuildervalueDistribution(String... label)Creates a quantizeQuantize.Builderfor a value distribution, i.e.static Quantize.BuildervalueDistribution(Column... column)Creates a quantizeQuantize.Builderfor a value distribution, i.e.
-
-
-
Field Detail
-
COUNT
public static final Quantize.Function.Factory COUNT
Function to count values.
-
SUM
public static final Quantize.Function.Factory SUM
Function to add values as doubles.
-
SUM_LONG
public static final Quantize.Function.Factory SUM_LONG
Function to add values as longs.
-
SUM_BYTES
public static final Quantize.Function.Factory SUM_BYTES
Function to add values as Bytes.- Since:
- 1.12
-
MIN
public static final Quantize.Function.Factory MIN
Function to find the minimum double value.
-
MIN_LONG
public static final Quantize.Function.Factory MIN_LONG
Function to find the minimum long value.
-
MIN_BYTES
public static final Quantize.Function.Factory MIN_BYTES
Function to find the minimum Bytes value.- Since:
- 1.12
-
MAX
public static final Quantize.Function.Factory MAX
Function to find the maximum double value.
-
MAX_LONG
public static final Quantize.Function.Factory MAX_LONG
Function to find the maximum long value.
-
MAX_BYTES
public static final Quantize.Function.Factory MAX_BYTES
Function to find the maximum Bytes value.- Since:
- 1.12
-
AVERAGE
public static final Quantize.Function.Factory AVERAGE
Function to find the average value.
-
AVERAGE_LONG
public static final Quantize.Function.Factory AVERAGE_LONG
Function to find the average long value.- Since:
- 0.8
-
AVERAGE_BYTES
public static final Quantize.Function.Factory AVERAGE_BYTES
Function to find the average Bytes value.- Since:
- 1.12
-
-
Method Detail
-
valueDistribution
public static Quantize.Builder valueDistribution(String... label)
Creates a quantizeQuantize.Builderfor 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 quantizeQuantize.Builderfor 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 quantizeQuantize.Builderfor 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 columnlowerBound- The lower bound of the distributionupperBound- The upper bound of the distributionstep- 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 quantizeQuantize.Builderfor a linear frequency distribution on long values.linearFrequencyDistribution(String, double, double, double)- Parameters:
label- How to label this quantizationlowerBound- the lowest long valueupperBound- the highest long valuestep- 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 SnapshotExceptionAdd one value to the quantize function representing one heap object.- Parameters:
objectId- the heap object represented by this valuecolumnValues- 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 SnapshotExceptionAdd one value to the quantize function representing a set of objects.- Parameters:
objectIds- the heap objects represented by this valuecolumnValues- the column values- Throws:
SnapshotException- if there is a problem, perhaps such as an invalid objectId
-
-