Package org.eclipse.mat.query.refined

# Class RefinedResultBuilder

java.lang.Object
org.eclipse.mat.query.refined.RefinedResultBuilder

public final class RefinedResultBuilder extends Object
This class allows the wrapping of a result to give another result which can be controlled more.

## Constructor Summary

Constructors
Constructor
Description
`RefinedResultBuilder(IQueryContext context, IStructuredResult subject)`
Build a suitable refined result given an input of IResultTable or IResultTree.

## Method Summary

Modifier and Type
Method
Description
`void`
`addContextDerivedColumn(ContextProvider provider, ContextDerivedData.DerivedOperation operation)`
`void`
`addDefaultContextDerivedColumn(ContextDerivedData.DerivedOperation operation)`
Add a derived column such as for retained size.
`RefinedStructuredResult`
`build()`
Build the refined result (one time operation).
`int`
`getColumnIndexByName(String columnName)`
Retrieve a column by name.
`List<Column>`
`getColumns()`
Get all the columns
`void`
`setFilter(int columnIndex, String criteria)`
Filter a particular column to only have partial data.
`void`
`setInlineRetainedSizeCalculation(boolean inline)`
`void`
`setSortOrder(int[] indices, Column.SortDirection[] directions)`
Arrange to sort the table by multiple columns.
`void`
`setSortOrder(int columnIndex, Column.SortDirection direction)`
Arrange to sort the table by a particular column.

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### RefinedResultBuilder

public RefinedResultBuilder(IQueryContext context, IStructuredResult subject)
Build a suitable refined result given an input of IResultTable or IResultTree.

Parameters:
  `context` - the context holding details about what was selected etc.
  `subject` - the structured result

## Method Details

### getColumnIndexByName

public int getColumnIndexByName(String columnName)
Retrieve a column by name.

Parameters:
  `columnName` - the name of the column
Returns:
  the column of data

### setSortOrder

public void setSortOrder(int columnIndex, Column.SortDirection direction)
Arrange to sort the table by a particular column.

Parameters:
  `columnIndex` - the index of the column to sort by
  `direction` - the direction to sort

### setSortOrder

public void setSortOrder(int[] indices, Column.SortDirection[] directions)
Arrange to sort the table by multiple columns.

Parameters:
  `indices` - the indices to sort by
  `directions` - the direction to sort each index by

### addDefaultContextDerivedColumn

public void addDefaultContextDerivedColumn(ContextDerivedData.DerivedOperation operation)
Add a derived column such as for retained size.

Parameters:
  `operation` - the extra operation for the new column

### addContextDerivedColumn

public void addContextDerivedColumn(ContextProvider provider, ContextDerivedData.DerivedOperation operation)

### setFilter

public void setFilter(int columnIndex, String criteria) throws IllegalArgumentException
Filter a particular column to only have partial data.

Parameters:
  `columnIndex` - the column of interest
  `criteria` - how to filter that column
Throws:
  `IllegalArgumentException` - for a bad criterion

### getColumns

public List<Column> getColumns()
Get all the columns

Returns:
  An unmodifiable list of all the columns.

### setInlineRetainedSizeCalculation

public void setInlineRetainedSizeCalculation(boolean inline)

### build

public RefinedStructuredResult build()
Build the refined result (one time operation). The builder is not reusable.

Returns:
  the refined result table or tree.