Class Selector.Factory

    • Constructor Detail

      • Factory

        public Factory()
    • Method Detail

      • addFunctionsTo

        public void addFunctionsTo​(java.util.List<Function> functions)
      • getColumnSpecification

        public ColumnSpecification getColumnSpecification​(TableMetadata table)
        Returns the column specification corresponding to the output value of the selector instances created by this factory.
        Parameters:
        table - the table meta data
        Returns:
        a column specification
      • newInstance

        public abstract Selector newInstance​(QueryOptions options)
        Creates a new Selector instance.
        Parameters:
        options - the options of the query for which the instance is created (some selector depends on the bound values in particular).
        Returns:
        a new Selector instance
      • isAggregateSelectorFactory

        public boolean isAggregateSelectorFactory()
        Checks if this factory creates selectors instances that creates aggregates.
        Returns:
        true if this factory creates selectors instances that creates aggregates, false otherwise
      • isWritetimeSelectorFactory

        public boolean isWritetimeSelectorFactory()
        Checks if this factory creates writetime selectors instances.
        Returns:
        true if this factory creates writetime selectors instances, false otherwise
      • isMaxWritetimeSelectorFactory

        public boolean isMaxWritetimeSelectorFactory()
        Checks if this factory creates maxwritetime selector instances.
        Returns:
        true if this factory creates maxwritetime selectors instances, false otherwise
      • isTTLSelectorFactory

        public boolean isTTLSelectorFactory()
        Checks if this factory creates TTL selectors instances.
        Returns:
        true if this factory creates TTL selectors instances, false otherwise
      • isSimpleSelectorFactory

        public boolean isSimpleSelectorFactory()
        Checks if this factory creates Selectors that simply return a column value.
        Returns:
        true if this factory creates Selectors that simply return a column value, false otherwise.
      • isSimpleSelectorFactoryFor

        public boolean isSimpleSelectorFactoryFor​(int index)
        Checks if this factory creates Selectors that simply return the specified column.
        Parameters:
        index - the column index
        Returns:
        true if this factory creates Selectors that simply return the specified column, false otherwise.
      • getColumnName

        protected abstract java.lang.String getColumnName()
        Returns the name of the column corresponding to the output value of the selector instances created by this factory.
        Returns:
        a column name
      • getReturnType

        protected abstract AbstractType<?> getReturnType()
        Returns the type of the values returned by the selector instances created by this factory.
        Returns:
        the selector output type
      • addColumnMapping

        protected abstract void addColumnMapping​(SelectionColumnMapping mapping,
                                                 ColumnSpecification resultsColumn)
        Record a mapping between the ColumnDefinitions that are used by the selector instances created by this factory and a column in the ResultSet.Metadata returned with a query. In most cases, this is likely to be a 1:1 mapping, but some selector instances may utilise multiple columns (or none at all) to produce a value (i.e. functions).
        Parameters:
        mapping - the instance of the column mapping belonging to the current query's Selection
        resultsColumn - the column in the ResultSet.Metadata to which the ColumnDefinitions used by the Selector are to be mapped