Class ComputedColumn

  • All Implemented Interfaces:
    java.lang.Cloneable, IStructure, org.eclipse.birt.report.model.core.IPropertySet

    public class ComputedColumn
    extends org.eclipse.birt.report.model.core.PropertyStructure
    Represents one computed column. A computed column is a 'virtual' column produced as an expression of other columns within the data set.

    This is a managed object, meaning that all changes should be made though the command layer so that they can be undone and redone. Each computed column has the following properties:

    Column Name
    a computed column has a required column name.
    Expression
    expression of the computation for the column.
    • Constructor Summary

      Constructors 
      Constructor Description
      ComputedColumn()  
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      void addAggregateOn​(java.lang.String aggreValue)
      Adds an aggregate level to the list.
      void addArgument​(AggregationArgument argument)
      Adds an argument to list.
      void addCalculationArgument​(CalculationArgument argument)
      Adds a calculation argument to list.
      boolean allowExport()
      Gets the flag which indicates whether the computed column supports export.
      void clearAggregateOnList()
      Sets the expression used to define this computed column.
      java.lang.String getAggregateFunction()
      Returns the expression used to define this computed column.
      java.lang.String getAggregateOn()
      Returns the aggregateOn expression to compute.
      java.util.List getAggregateOnList()
      Returns the list containing levels to be aggregated on.
      java.lang.String getAggregrateOn()
      Deprecated.
      java.lang.String getColumnName()
      Deprecated.
      using getName() instead.
      java.lang.String getDataType()
      Returns the data type of this column.
      java.lang.String getDisplayName()
      Returns column display name.
      java.lang.String getDisplayNameID()
      Gets column display name id.
      java.lang.String getExpression()
      Returns the expression to compute.
      java.lang.String getFilterExpression()
      Returns the expression used to define this computed column.
      java.lang.String getName()
      Returns the column name.
      java.lang.String getStructName()
      Returns the name of the structure definition.
      StructureHandle handle​(SimpleValueHandle valueHandle, int index)
      Creates the specific handle of this structure.
      void removeAggregateOn​(java.lang.String aggreValue)
      Removes an aggregate level from the list.
      void removeArgument​(AggregationArgument argument)
      Removes an argument from list.
      void removeCalculationArgument​(CalculationArgument argument)
      Removes a calculation argument from list.
      void setAggregateFunction​(java.lang.String expression)
      Sets the expression used to define this computed column.
      void setAggregateOn​(java.lang.String aggregateOn)
      Sets the aggregateOn expression.
      void setAggregrateOn​(java.lang.String aggregateOn)
      Deprecated.
      void setAllowExport​(boolean allowExport)
      Sets the flag which indicates whether the computed column supports export.
      void setCalculationType​(java.lang.String calculationType)
      Sets the calculation type.
      void setColumnName​(java.lang.String columnName)
      Deprecated.
      using setName(String) instead.
      void setDataType​(java.lang.String dataType)
      Sets the data type of this column.
      void setDisplayName​(java.lang.String columnDisplayName)
      Sets the column display name.
      void setDisplayNameID​(java.lang.String displayNameID)
      Sets the column display name id.
      void setExpression​(java.lang.String expression)
      Sets the expression.
      void setFilterExpression​(java.lang.String expression)
      Sets the expression used to define this computed column.
      void setName​(java.lang.String name)
      Sets the column name
      void setReferenceDateType​(java.lang.String type)
      Sets the reference date type.
      void setReferenceDateValue​(Expression expr)
      Sets the reference date value with the expression value.
      void setTimeDimension​(java.lang.String expr)
      Sets the time dimension expression value.
      java.util.List validate​(org.eclipse.birt.report.model.core.Module module, org.eclipse.birt.report.model.core.DesignElement element)
      Validates this structure.
      • Methods inherited from class org.eclipse.birt.report.model.core.PropertyStructure

        clone, getIntrinsicProperty, getLocalProperty, getLocalProperty, setIntrinsicProperty, setProperty
      • Methods inherited from class org.eclipse.birt.report.model.core.Structure

        checkStringMember, copy, equals, getCompatibleValue, getContext, getDefn, getElement, getExpressionProperty, getHandle, getHandle, getMemberDefn, getObjectDefn, getProperty, getProperty, getReferencableProperty, getStringProperty, isDesignTime, isReferencable, setContext, setExpressionProperty, setProperty, setupContext, updateReference
      • Methods inherited from class java.lang.Object

        finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • COMPUTED_COLUMN_STRUCT

        public static final java.lang.String COMPUTED_COLUMN_STRUCT
        Name of this structure. Matches the definition in the meta-data dictionary.
        See Also:
        Constant Field Values
      • NAME_MEMBER

        public static final java.lang.String NAME_MEMBER
        Name of the column name member.
        See Also:
        Constant Field Values
      • DISPLAY_NAME_MEMBER

        public static final java.lang.String DISPLAY_NAME_MEMBER
        DisplayName of the column name member.
        See Also:
        Constant Field Values
      • DISPLAY_NAME_ID_MEMBER

        public static final java.lang.String DISPLAY_NAME_ID_MEMBER
        DisplayNameID of the column name member.
        See Also:
        Constant Field Values
      • COLUMN_NAME_MEMBER

        @Deprecated
        public static final java.lang.String COLUMN_NAME_MEMBER
        Deprecated.
        using NAME_MEMBER instead.
        Name of the column name member.
        See Also:
        Constant Field Values
      • EXPRESSION_MEMBER

        public static final java.lang.String EXPRESSION_MEMBER
        Name of the expression member.
        See Also:
        Constant Field Values
      • DATA_TYPE_MEMBER

        public static final java.lang.String DATA_TYPE_MEMBER
        Name of the data-type member.
        See Also:
        Constant Field Values
      • AGGREGATEON_MEMBER

        public static final java.lang.String AGGREGATEON_MEMBER
        Name of the aggregateOn member.
        See Also:
        Constant Field Values
      • AGGREGRATEON_MEMBER

        @Deprecated
        public static final java.lang.String AGGREGRATEON_MEMBER
        Deprecated.
        Name of the aggregateOn member.
        See Also:
        Constant Field Values
      • AGGREGATEON_FUNCTION_MEMBER

        public static final java.lang.String AGGREGATEON_FUNCTION_MEMBER
        Name of the aggregateOn member.
        See Also:
        Constant Field Values
      • ARGUMENTS_MEMBER

        public static final java.lang.String ARGUMENTS_MEMBER
        Name of arguments of function member.
        See Also:
        Constant Field Values
      • FILTER_MEMBER

        public static final java.lang.String FILTER_MEMBER
        Name of the filter member.
        See Also:
        Constant Field Values
      • ALLOW_EXPORT_MEMBER

        public static final java.lang.String ALLOW_EXPORT_MEMBER
        Name of the allowExport member.
        See Also:
        Constant Field Values
      • CALCULATION_TYPE_MEMBER

        public static final java.lang.String CALCULATION_TYPE_MEMBER
        Name of the member that specifies the calculation function name. The function name is defined by customer DB executor.
        See Also:
        Constant Field Values
      • CALCULATION_ARGUMENTS_MEMBER

        public static final java.lang.String CALCULATION_ARGUMENTS_MEMBER
        Name of the member that specifies a list of calculation argument for the specific calculation function.
        See Also:
        Constant Field Values
      • REFERENCE_DATE_TYPE_MEMBER

        public static final java.lang.String REFERENCE_DATE_TYPE_MEMBER
        Name of the member that specifies the reference date type.
        See Also:
        Constant Field Values
      • REFERENCE_DATE_VALUE_MEMBER

        public static final java.lang.String REFERENCE_DATE_VALUE_MEMBER
        Name of the member that specifies the reference date value. It is required when reference date type is fixed date.
        See Also:
        Constant Field Values
      • TIME_DIMENSION_MEMBER

        public static final java.lang.String TIME_DIMENSION_MEMBER
        Name of the member that specifies the expression that returns the name of time dimension.
        See Also:
        Constant Field Values
    • Constructor Detail

      • ComputedColumn

        public ComputedColumn()
    • Method Detail

      • getStructName

        public java.lang.String getStructName()
        Description copied from interface: IStructure
        Returns the name of the structure definition. The name is the one used to define the structure in the meta-data dictionary.
        Returns:
        the internal name of the structure a defined in the meta-data dictionary.
      • getColumnName

        @Deprecated
        public java.lang.String getColumnName()
        Deprecated.
        using getName() instead.
        Returns the column name.
        Returns:
        the column name
      • getName

        public java.lang.String getName()
        Returns the column name.
        Returns:
        the column name
      • getDisplayName

        public java.lang.String getDisplayName()
        Returns column display name.
        Returns:
        column display name.
      • getDisplayNameID

        public java.lang.String getDisplayNameID()
        Gets column display name id.
        Returns:
        the column display name id.
      • setDisplayName

        public void setDisplayName​(java.lang.String columnDisplayName)
        Sets the column display name.
        Parameters:
        columnDisplayName - the column display name to set.
      • setDisplayNameID

        public void setDisplayNameID​(java.lang.String displayNameID)
        Sets the column display name id.
        Parameters:
        displayNameID - the column display name id.
      • setColumnName

        @Deprecated
        public void setColumnName​(java.lang.String columnName)
        Deprecated.
        using setName(String) instead.
        Sets the column name.
        Parameters:
        columnName - the column name to set
      • setName

        public void setName​(java.lang.String name)
        Sets the column name
        Parameters:
        name - the column name to set.
      • getExpression

        public java.lang.String getExpression()
        Returns the expression to compute.
        Returns:
        the expression to compute
      • setExpression

        public void setExpression​(java.lang.String expression)
        Sets the expression.
        Parameters:
        expression - the expression to set
      • handle

        public StructureHandle handle​(SimpleValueHandle valueHandle,
                                      int index)
        Description copied from class: org.eclipse.birt.report.model.core.Structure
        Creates the specific handle of this structure. This handle is always created.
        Specified by:
        handle in class org.eclipse.birt.report.model.core.Structure
        Parameters:
        valueHandle - the value handle of this structure list property this structure is in
        index - the position of this structure in structure list
        Returns:
        the handle of this structure.
      • validate

        public java.util.List validate​(org.eclipse.birt.report.model.core.Module module,
                                       org.eclipse.birt.report.model.core.DesignElement element)
        Validates this structure. The following are the rules:
        • The column name is required.
        Overrides:
        validate in class org.eclipse.birt.report.model.core.Structure
        Parameters:
        module - the module
        element - the element contains this structure
        Returns:
        the semantic error list
        See Also:
        Structure.validate(Module, org.eclipse.birt.report.model.core.DesignElement)
      • getDataType

        public java.lang.String getDataType()
        Returns the data type of this column. The possible values are defined in DesignChoiceConstants, and they are:
        • COLUMN_DATA_TYPE_ANY
        • COLUMN_DATA_TYPE_INTEGER
        • COLUMN_DATA_TYPE_STRING
        • COLUMN_DATA_TYPE_DATETIME
        • COLUMN_DATA_TYPE_DECIMAL
        • COLUMN_DATA_TYPE_FLOAT
        • COLUMN_DATA_TYPE_STRUCTURE
        • COLUMN_DATA_TYPE_TABLE
        Returns:
        the data type of this column.
      • setDataType

        public void setDataType​(java.lang.String dataType)
        Sets the data type of this column. The allowed values are defined in DesignChoiceConstants, and they are:
        • COLUMN_DATA_TYPE_ANY
        • COLUMN_DATA_TYPE_INTEGER
        • COLUMN_DATA_TYPE_STRING
        • COLUMN_DATA_TYPE_DATETIME
        • COLUMN_DATA_TYPE_DECIMAL
        • COLUMN_DATA_TYPE_FLOAT
        • COLUMN_DATA_TYPE_STRUCTURE
        • COLUMN_DATA_TYPE_TABLE
        Parameters:
        dataType - the data type to set
      • getAggregrateOn

        @Deprecated
        public java.lang.String getAggregrateOn()
        Deprecated.
        Returns the aggregrateOn expression to compute.
        Returns:
        the aggregrateOn expression to compute.
      • setAggregrateOn

        @Deprecated
        public void setAggregrateOn​(java.lang.String aggregateOn)
        Deprecated.
        Sets the aggregateOn expression.
        Parameters:
        aggregateOn - the aggregateOn expression to set
      • getAggregateOn

        public java.lang.String getAggregateOn()
        Returns the aggregateOn expression to compute.
        Returns:
        the aggregateOn expression to compute.
      • getAggregateOnList

        public java.util.List getAggregateOnList()
        Returns the list containing levels to be aggregated on.
        Returns:
        the list containing levels to be aggregated on
      • setAggregateOn

        public void setAggregateOn​(java.lang.String aggregateOn)
        Sets the aggregateOn expression.
        Parameters:
        aggregateOn - the aggregateOn expression to set
      • addAggregateOn

        public void addAggregateOn​(java.lang.String aggreValue)
        Adds an aggregate level to the list.
        Parameters:
        aggreValue - the aggregate name. For listing elements, this can be "All" or the name of a single group.
      • removeAggregateOn

        public void removeAggregateOn​(java.lang.String aggreValue)
        Removes an aggregate level from the list.
        Parameters:
        aggreValue - the aggregate name. For listing elements, this can be "All" or the name of a single group.
      • getAggregateFunction

        public java.lang.String getAggregateFunction()
        Returns the expression used to define this computed column.
        Returns:
        the expression used to define this computed column
      • getFilterExpression

        public java.lang.String getFilterExpression()
        Returns the expression used to define this computed column.
        Returns:
        the expression used to define this computed column
      • setAggregateFunction

        public void setAggregateFunction​(java.lang.String expression)
        Sets the expression used to define this computed column.
        Parameters:
        expression - the expression to set
        Throws:
        SemanticException - value required exception
      • setFilterExpression

        public void setFilterExpression​(java.lang.String expression)
        Sets the expression used to define this computed column.
        Parameters:
        expression - the expression to set
        Throws:
        SemanticException - value required exception
      • clearAggregateOnList

        public void clearAggregateOnList()
        Sets the expression used to define this computed column.
        Parameters:
        expression - the expression to set
        Throws:
        SemanticException - value required exception
      • addArgument

        public void addArgument​(AggregationArgument argument)
        Adds an argument to list.
        Parameters:
        argument - the aggregate function argument
      • removeArgument

        public void removeArgument​(AggregationArgument argument)
        Removes an argument from list.
        Parameters:
        argument - the aggregate function argument
      • allowExport

        public boolean allowExport()
        Gets the flag which indicates whether the computed column supports export.
        Returns:
        true if it allows, otherwise false.
      • setAllowExport

        public void setAllowExport​(boolean allowExport)
        Sets the flag which indicates whether the computed column supports export.
        Parameters:
        allowExport - the flag to set
      • setCalculationType

        public void setCalculationType​(java.lang.String calculationType)
        Sets the calculation type.
        Parameters:
        calculationType -
      • addCalculationArgument

        public void addCalculationArgument​(CalculationArgument argument)
        Adds a calculation argument to list.
        Parameters:
        argument - the calculation argument
      • removeCalculationArgument

        public void removeCalculationArgument​(CalculationArgument argument)
        Removes a calculation argument from list.
        Parameters:
        argument - the calculation argument
      • setReferenceDateValue

        public void setReferenceDateValue​(Expression expr)
        Sets the reference date value with the expression value. It must be set when reference date type is TODAY.
        Parameters:
        expr -
      • setReferenceDateType

        public void setReferenceDateType​(java.lang.String type)
        Sets the reference date type.
        Parameters:
        offset -
      • setTimeDimension

        public void setTimeDimension​(java.lang.String expr)
        Sets the time dimension expression value.
        Parameters:
        expr -