Class GrelEvaluable

    • Constructor Detail

      • GrelEvaluable

        public GrelEvaluable​(GrelExpr expr,
                             String languagePrefix)
    • Method Detail

      • evaluate

        public Object evaluate​(Properties bindings)
        Description copied from interface: Evaluable
        Evaluate this expression in the given environment (bindings).
        Specified by:
        evaluate in interface Evaluable
      • getColumnDependencies

        public Set<String> getColumnDependencies​(String baseColumn)
        Description copied from interface: Evaluable
        Returns the names of the columns this expression depends on.
        Specified by:
        getColumnDependencies in interface Evaluable
        Parameters:
        baseColumn - the name of the column this expression is based on (null if none)
        Returns:
        null if the columns could not be isolated: in this case, the expression might depend on all columns in the project.
      • renameColumnDependencies

        public Evaluable renameColumnDependencies​(Map<String,​String> substitutions)
        Description copied from interface: Evaluable
        Translates this expression by simultaneously substituting column names as the supplied map specifies.

        This is only possible if the extraction of column dependencies with Evaluable.getColumnDependencies(String) succeeds (return a non-null value).

        Specified by:
        renameColumnDependencies in interface Evaluable
        Parameters:
        substitutions - a map specifying new names for some columns. If a column name is not present in the map, it is assumed that the column is not renamed.
        Returns:
        a new expression with updated column names.
      • getLanguagePrefix

        public String getLanguagePrefix()
        Specified by:
        getLanguagePrefix in interface Evaluable
        Returns:
        the language prefix used to generate this evaluable.
      • isLocal

        public boolean isLocal()
        Specified by:
        isLocal in interface Evaluable
        Returns:
        true when the evaluable can be computed fully (and quickly) from the local context (the given row or record). If it relies on any other information (external web service, aggregation over the project), then it should return false, indicating that the return value may need to be cached by the caller.