Package org.eclipse.mat.query
Class Column
- java.lang.Object
-
- org.eclipse.mat.query.Column
-
public final class Column extends java.lang.ObjectDescribes a column of aIStructuredResult.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classColumn.AlignmentAlignment of the column, i.e.static classColumn.SortDirectionSort direction of the column.
-
Constructor Summary
Constructors Constructor Description Column(java.lang.String label)Build a column with the given label.Column(java.lang.String label, java.lang.Class<?> type)Build a column with the given label.Column(java.lang.String label, java.lang.Class<?> type, Column.Alignment align, Column.SortDirection direction, java.text.Format formatter, java.util.Comparator<?> comparator)Build a column with the given label.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Columnaligning(Column.Alignment align)Alignment of the column.Columncomparing(java.util.Comparator<?> comparator)Comparator to sort the column.Columndecorator(IDecorator decorator)Add a decorator to a columnbooleanequals(java.lang.Object obj)Columnformatting(java.text.Format formatter)Formatter to format the column values.Column.AlignmentgetAlign()booleangetCalculateTotals()java.util.Comparator<?>getComparator()java.lang.ObjectgetData(java.lang.Object key)IDecoratorgetDecorator()java.text.FormatgetFormatter()java.lang.StringgetLabel()Column.SortDirectiongetSortDirection()java.lang.Class<?>getType()inthashCode()booleanisNumeric()Returns true if the columns represents a numeric type, i.e.ColumnnoTotals()Indicates that no totals are to be calculated for the column even if the column contains numbers.java.lang.ObjectsetData(java.lang.Object key, java.lang.Object value)Columnsorting(Column.SortDirection direction)Initial sort direction of the column.java.lang.StringtoString()
-
-
-
Constructor Detail
-
Column
public Column(java.lang.String label)
Build a column with the given label.- Parameters:
label- the top of the column
-
Column
public Column(java.lang.String label, java.lang.Class<?> type)Build a column with the given label.- Parameters:
label- the top of the columntype- a type of the column, such as float, int, Double
-
Column
public Column(java.lang.String label, java.lang.Class<?> type, Column.Alignment align, Column.SortDirection direction, java.text.Format formatter, java.util.Comparator<?> comparator)Build a column with the given label.- Parameters:
label- the top of the columntype- a type of the column, such as float, int, Doublealign- cell alignment - seeColumn.Alignmentfor the choicesdirection- sorting directionformatter- how to display itemscomparator- how to sort the items
-
-
Method Detail
-
formatting
public Column formatting(java.text.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(java.util.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 java.lang.Class<?> getType()
-
getAlign
public Column.Alignment getAlign()
-
getSortDirection
public Column.SortDirection getSortDirection()
-
getLabel
public java.lang.String getLabel()
-
getComparator
public java.util.Comparator<?> getComparator()
-
getFormatter
public java.text.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 java.lang.Object setData(java.lang.Object key, java.lang.Object value)
-
getData
public java.lang.Object getData(java.lang.Object key)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
-