Package com.illumon.iris.db.v2.select
Class ReinterpretedColumn<S,D>
java.lang.Object
com.illumon.iris.db.v2.select.ReinterpretedColumn<S,D>
- All Implemented Interfaces:
SelectColumn
public class ReinterpretedColumn<S,D> extends Object implements SelectColumn
Allows
ColumnSource
reinterpretation via view-type (Table.view(com.illumon.iris.db.v2.select.SelectColumn...)
and Table.updateView(com.illumon.iris.db.v2.select.SelectColumn...)
)
Table
operations.-
Field Summary
Fields inherited from interface com.illumon.iris.db.v2.select.SelectColumn
ZERO_LENGTH_SELECT_COLUMN_ARRAY
-
Constructor Summary
Constructors Constructor Description ReinterpretedColumn(String sourceName, Class<S> sourceDataType, String destName, Class<D> destDataType, Object... reinterpParams)
Create aReinterpretedColumn
that attempts to convert the source column into the destination type, optionally with parameters. -
Method Summary
Modifier and Type Method Description ReinterpretedColumn<S,D>
copy()
Create a copy of this SelectColumn.boolean
disallowRefresh()
Should we disallow use of this column for refreshing tables? Some formulas can not be reliably computed with a refreshing table, therefore we will refuse to compute those values.boolean
equals(Object o)
List<String>
getColumnArrays()
Get a list of the names of column arrays used in this SelectColumn.List<String>
getColumns()
Get a list of the names of columns used in this SelectColumn.ColumnSource
getDataView()
Get aColumnSource
that can be used to access the data on demand.ColumnSource
getLazyView()
Returns a lazily computed view of this column.MatchPair
getMatchPair()
Get a MatchPair for this column, if applicable.String
getName()
Get the name of the resultant column.Class
getReturnedType()
Get the data type stored in the resultant column.int
hashCode()
List<String>
initDef(Map<String,com.illumon.dataobjects.ColumnDefinition> columnDefinitionMap)
Initialize any internal column definitions from the provided initial.List<String>
initInputs(Table table)
Initialize the SelectColumn using the input table and return a list of underlying columns that this SelectColumn is dependent upon.List<String>
initInputs(Index index, Map<String,? extends ColumnSource> columnsOfInterest)
Initialize the column from the provided set of underlying columns and index.boolean
isRetain()
WritableSource
newDestInstance(long size)
Create a newWritableSource
with sufficient capacity for the rows in the index.String
toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.illumon.iris.db.v2.select.SelectColumn
alwaysEvaluate, alwaysEvaluateCopy, getConstantValueView
-
Constructor Details
-
ReinterpretedColumn
public ReinterpretedColumn(@NotNull String sourceName, @NotNull Class<S> sourceDataType, @NotNull String destName, @NotNull Class<D> destDataType, Object... reinterpParams)Create aReinterpretedColumn
that attempts to convert the source column into the destination type, optionally with parameters.- Parameters:
sourceName
- the name of the Source column within the tablesourceDataType
- the type of the source columndestName
- the name of the desired destination columndestDataType
- the type to try to convert toreinterpParams
- a varargs set of parameters for the arguments if required.
-
-
Method Details
-
toString
-
initInputs
Description copied from interface:SelectColumn
Initialize the SelectColumn using the input table and return a list of underlying columns that this SelectColumn is dependent upon.- Specified by:
initInputs
in interfaceSelectColumn
- Parameters:
table
- the table to initialize internals from- Returns:
- a list containing all columns from 'table' that the result depends on
-
initInputs
Description copied from interface:SelectColumn
Initialize the column from the provided set of underlying columns and index.- Specified by:
initInputs
in interfaceSelectColumn
- Parameters:
index
- the base indexcolumnsOfInterest
- the input columns- Returns:
- a list of columns on which the result of this is dependent
-
initDef
public List<String> initDef(Map<String,com.illumon.dataobjects.ColumnDefinition> columnDefinitionMap)Description copied from interface:SelectColumn
Initialize any internal column definitions from the provided initial.- Specified by:
initDef
in interfaceSelectColumn
- Parameters:
columnDefinitionMap
- the starting set of column definitions- Returns:
- a list of columns on which the result of this is dependent
-
getReturnedType
Description copied from interface:SelectColumn
Get the data type stored in the resultant column.- Specified by:
getReturnedType
in interfaceSelectColumn
- Returns:
- the type
-
getColumns
Description copied from interface:SelectColumn
Get a list of the names of columns used in this SelectColumn. Behavior is undefined if none of the init* methods have been called yet.- Specified by:
getColumns
in interfaceSelectColumn
- Returns:
- the columns used in this SelectColumn
-
getColumnArrays
Description copied from interface:SelectColumn
Get a list of the names of column arrays used in this SelectColumn. Behavior is undefined if none of the init* methods have been called yet.- Specified by:
getColumnArrays
in interfaceSelectColumn
- Returns:
- the list of column arrays used
-
getDataView
Description copied from interface:SelectColumn
Get aColumnSource
that can be used to access the data on demand.- Specified by:
getDataView
in interfaceSelectColumn
- Returns:
- a
ColumnSource
-
getLazyView
Description copied from interface:SelectColumn
Returns a lazily computed view of this column.- Specified by:
getLazyView
in interfaceSelectColumn
- Returns:
- a lazily computed column source
-
getName
Description copied from interface:SelectColumn
Get the name of the resultant column.- Specified by:
getName
in interfaceSelectColumn
- Returns:
- the name of the column
-
getMatchPair
Description copied from interface:SelectColumn
Get a MatchPair for this column, if applicable.- Specified by:
getMatchPair
in interfaceSelectColumn
- Returns:
-
newDestInstance
Description copied from interface:SelectColumn
Create a newWritableSource
with sufficient capacity for the rows in the index.- Specified by:
newDestInstance
in interfaceSelectColumn
- Parameters:
size
- The number of rows to allocate- Returns:
- a new
WritableSource
with sufficient capacity for 'dataSubset'
-
isRetain
public boolean isRetain()- Specified by:
isRetain
in interfaceSelectColumn
- Returns:
-
equals
-
hashCode
public int hashCode() -
disallowRefresh
public boolean disallowRefresh()Description copied from interface:SelectColumn
Should we disallow use of this column for refreshing tables? Some formulas can not be reliably computed with a refreshing table, therefore we will refuse to compute those values.- Specified by:
disallowRefresh
in interfaceSelectColumn
-
copy
Description copied from interface:SelectColumn
Create a copy of this SelectColumn.- Specified by:
copy
in interfaceSelectColumn
- Returns:
- an independent copy of this SelectColumn.
-