Package org.eclipse.mat.query

## Class Column

- java.lang.Object
- - org.eclipse.mat.query.Column

    public final class Column
    extends Object

Describes a column of a `IStructuredResult`.

### Nested Class Summary

Nested Classes
`static class` `Column.Alignment` Alignment of the column, i.e.
`static class` `Column.SortDirection` Sort direction of the column.

### Constructor Summary

Constructors
`Column​(String label)` Build a column with the given label.
`Column​(String label, Class<?> type)` Build a column with the given label.
`Column​(String label, Class<?> type, Column.Alignment align, Column.SortDirection direction, Format formatter, Comparator<?> comparator)` Build a column with the given label.

### Method Summary

All Methods Instance Methods Concrete Methods
`Column` `aligning​(Column.Alignment align)` Alignment of the column.
`Column` `comparing​(Comparator<?> comparator)` Comparator to sort the column.
`Column` `decorator​(IDecorator decorator)` Add a decorator to a column
`boolean` `equals​(Object obj)`
`Column` `formatting​(Format formatter)` Formatter to format the column values.
`Column.Alignment` `getAlign()`
`boolean` `getCalculateTotals()`
`Comparator<?>` `getComparator()`
`Object` `getData​(Object key)`
`IDecorator` `getDecorator()`
`Format` `getFormatter()`
`String` `getLabel()`
`Column.SortDirection` `getSortDirection()`
`Class<?>` `getType()`
`int` `hashCode()`
`boolean` `isNumeric()` Returns true if the columns represents a numeric type, i.e.
`Column` `noTotals()` Indicates that no totals are to be calculated for the column even if the column contains numbers.
`Object` `setData​(Object key, Object value)`
`Column` `sorting​(Column.SortDirection direction)` Initial sort direction of the column.

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

`getClass, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### Column

    public Column​(String label)

Build a column with the given label.

Parameters:
  `label` - the top of the column

#### Column

    public Column​(String label,
                  Class<?> type)

Build a column with the given label.

Parameters:
  `label` - the top of the column
  `type` - a type of the column, such as float, int, Double

#### Column

    public Column​(String label,
                  Class<?> type,
                  Column.Alignment align,
                  Column.SortDirection direction,
                  Format formatter,
                  Comparator<?> comparator)

Build a column with the given label.

Parameters:
  `label` - the top of the column
  `type` - a type of the column, such as float, int, Double
  `align` - cell alignment - see `Column.Alignment` for the choices
  `direction` - sorting direction
  `formatter` - how to display items
  `comparator` - how to sort the items

### Method Detail

#### formatting

    public Column formatting​(Format formatter)

Formatter to format the column values.

Parameters:
  `formatter` - the formatter
Returns:
  the original column to allow chaining

#### aligning

    public Column aligning​(Column.Alignment align)

Alignment of the column.

Parameters:
  `align` - the alignment
Returns:
  the original column to allow chaining

#### comparing

    public Column comparing​(Comparator<?> comparator)

Comparator to sort the column. The row object will be passed to the comparator!

Parameters:
  `comparator` - the comparator for sorting
Returns:
  the original column to allow chaining

#### sorting

    public Column sorting​(Column.SortDirection direction)

Initial sort direction of the column.

Parameters:
  `direction` - the initial direction
Returns:
  the original column to allow chaining

#### noTotals

    public Column noTotals()

Indicates that no totals are to be calculated for the column even if the column contains numbers.

Returns:
  the original column to allow chaining

#### decorator

    public Column decorator​(IDecorator decorator)

Add a decorator to a column

Parameters:
  `decorator` - the decorator to allow a prefix or suffix
Returns:
  the original column to allow chaining

#### getType

    public Class<?> getType()

#### getAlign

    public Column.Alignment getAlign()

#### getSortDirection

    public Column.SortDirection getSortDirection()

#### getLabel

    public String getLabel()

#### getComparator

    public Comparator<?> getComparator()

#### getFormatter

    public Format getFormatter()

#### getCalculateTotals

    public boolean getCalculateTotals()

#### getDecorator

    public IDecorator getDecorator()

#### isNumeric

    public boolean isNumeric()

Returns true if the columns represents a numeric type, i.e. if it is assignable to number or one of the primitive numeric types.

Returns:
  true if numeric

#### setData

    public Object setData​(Object key,
                          Object value)

#### getData

    public Object getData​(Object key)

#### hashCode

    public int hashCode()

Overrides:
  `hashCode` in class `Object`

#### equals

    public boolean equals​(Object obj)

Overrides:
  `equals` in class `Object`