public class RowBasedColumnSelectorFactory<T> extends Object implements ColumnSelectorFactory
ColumnSelectorFactory that is based on an object supplier and a RowAdapter for that type of object.| Modifier and Type | Method and Description |
|---|---|
static <RowType> RowBasedColumnSelectorFactory<RowType> |
create(RowAdapter<RowType> adapter,
Supplier<RowType> supplier,
ColumnInspector columnInspector,
boolean throwParseExceptions,
boolean useStringValueOfNullInLists)
Create an instance based on any object, along with a
RowAdapter for that object. |
ColumnCapabilities |
getColumnCapabilities(String columnName)
Returns capabilities of a particular column, if known.
|
RowIdSupplier |
getRowIdSupplier()
Returns a
RowIdSupplier that allows callers to detect whether the selectors returned by this
factory have moved or not. |
ColumnValueSelector<?> |
makeColumnValueSelector(String columnName)
Returns ColumnValueSelector corresponding to the given column name, or
NilColumnValueSelector if the
column with such name is absent. |
DimensionSelector |
makeDimensionSelector(DimensionSpec dimensionSpec) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetColumnCapabilitiesWithDefault, getTypeareNumeric, areNumeric, areSameTypes, areSameTypes, areScalar, areScalar, canVectorize, canVectorizepublic static <RowType> RowBasedColumnSelectorFactory<RowType> create(RowAdapter<RowType> adapter, Supplier<RowType> supplier, ColumnInspector columnInspector, boolean throwParseExceptions, boolean useStringValueOfNullInLists)
RowAdapter for that object.adapter - adapter for these row objectssupplier - supplier of row objectscolumnInspector - will be used for reporting available columns and their capabilities. Note that
this factory will still allow creation of selectors on any named field in the
rows, even if it doesn't appear in "columnInspector". (It only needs to be
accessible via RowAdapter.columnFunction(java.lang.String).) As a result, you can achieve
an untyped mode by passing in
RowSignature.empty().throwParseExceptions - whether numeric selectors should throw parse exceptions or use a default/null
value when their inputs are not actually numericuseStringValueOfNullInLists - whether nulls in multi-value strings should be replaced with the string "null".
for example: the list ["a", null] would be converted to ["a", "null"]. Useful
for callers that need compatibility with Rows.objectToStrings(java.lang.Object).public DimensionSelector makeDimensionSelector(DimensionSpec dimensionSpec)
makeDimensionSelector in interface ColumnSelectorFactorypublic ColumnValueSelector<?> makeColumnValueSelector(String columnName)
ColumnSelectorFactoryNilColumnValueSelector if the
column with such name is absent.makeColumnValueSelector in interface ColumnSelectorFactory@Nullable public RowIdSupplier getRowIdSupplier()
ColumnSelectorFactoryRowIdSupplier that allows callers to detect whether the selectors returned by this
factory have moved or not. Useful for selectors that wrap other selectors, such as virtual columns,
as it allows them to cache their outputs.getRowIdSupplier in interface ColumnSelectorFactory@Nullable public ColumnCapabilities getColumnCapabilities(String columnName)
ColumnSelectorFactorygetColumnCapabilities in interface ColumnInspectorgetColumnCapabilities in interface ColumnSelectorFactorycolumnName - column nameCopyright © 2011–2023 The Apache Software Foundation. All rights reserved.