Class Formula

    • Field Detail

      • MAX_FORMULA_LENGTH

        public static final int MAX_FORMULA_LENGTH
        The maximum length of the formula that can be stored in the database. Check the length against this value before calling the setFormulas(List) method to avoid exceptions.
        See Also:
        Constant Field Values
    • Constructor Detail

    • Method Detail

      • getNew

        public static Formula getNew​(DbControl dc)
                              throws BaseException
        Create a new Formula item.
        Parameters:
        dc - The DbControl which will be used for permission checking and database access
        Returns:
        The new Formula item
        Throws:
        BaseException - If there is an error
      • getQuery

        public static ItemQuery<Formula> getQuery​(Formula.Type type,
                                                  RawDataType rawDataType,
                                                  IntensityTransform source)
        Get a query that return formulas that can be used with the specified raw data type. The formulas returned are those that match the specified raw data type or are generic for the number of channels.
        Parameters:
        type - The type of formula to return, or null to return any type
        rawDataType - The raw data type the formula should be useful for, or null to not filter on the raw data type
        source - Source data intensity transformation that the formula should be useful for. This includes all formulas that has specified the same transformation and those that hasn't specified any transformation at all. If this parameter is null, no filtering on intensity transformation is done.
        Returns:
        An ItemQuery object
        Since:
        2.12
      • getType

        public Item getType()
        Description copied from interface: Identifiable
        Get the type of item represented by the object. The returned value is one of the values defined in the Item enumeration.
        Specified by:
        getType in interface Identifiable
        Returns:
        A value indicating the type of item
      • getEntryDate

        public Date getEntryDate()
        Description copied from interface: Registered
        Get the date that the item was registered in the database.
        Specified by:
        getEntryDate in interface Registered
        Returns:
        A date or null if this is not known
      • setEntryDate

        public void setEntryDate​(Date entryDate)
        Description copied from interface: Registered
        Set the date the entry was registered in the database. Implementations should only allow this property to be set before the item is first stored in the database. The intention of this method is to facilitate export/import of data between server.
        Specified by:
        setEntryDate in interface Registered
        Parameters:
        entryDate - A date or null to use today's date
      • getFormulaType

        public Formula.Type getFormulaType()
        Get the type of formula. The type indicates in which situation the formula can be used.
        Returns:
        A Formula.Type object
      • getValueType

        public Type getValueType()
        Get the type of values that this formula produces.
        Returns:
        A Type object, or null if not known
        Since:
        2.15
      • getParser

        public Formula.Parser getParser()
        Get the parser that converts the formula to an expresion or restriction.
        Returns:
        A Formula.Parser object
      • getSourceIntensityTransform

        public IntensityTransform getSourceIntensityTransform()
        Get the intensity transformation that is required on spot data if this formula should generate the correct result.
        Returns:
        An intensity transform or null if the formula can be used on all types of spot data
        Since:
        2.12
      • setSourceIntensityTransform

        public void setSourceIntensityTransform​(IntensityTransform transform)
        Sets the transform that is required on spot data if this formula should generate the correct result.
        Parameters:
        transform - The required transform or null if the formula works with all kind of data
        Since:
        2.12
      • getResultIntensityTransform

        public IntensityTransform getResultIntensityTransform()
        Get the spot intensity transformation that this formula generates.
        Returns:
        An intensity transform or null if the formula generates the same kind of data used as source or doesn't generate intensity data at all
        Since:
        2.12
      • setResultIntensityTransform

        public void setResultIntensityTransform​(IntensityTransform transform)
        Sets the transform that this formula generates.
        Parameters:
        transform - An intensity transform or null if the formula generates the same kind of data used as source or doesn't generate intensity data at all
        Since:
        2.12
      • getRawDataType

        public RawDataType getRawDataType()
        Get the raw data type this formula can be used on. A null value indicates that the formula can be used on any raw data type.
        Returns:
        A RawDataType object
      • setRawDataType

        public void setRawDataType​(RawDataType rawDataType)
                            throws PermissionDeniedException
        Set the raw data type this formula can be used on. A null value indicates that the formula can be used on any raw data type.
        Parameters:
        rawDataType - The raw data type, or null
        Throws:
        PermissionDeniedException - If the logged in user doesn't have write permission
      • getChannels

        public int getChannels()
        Get the number of channels required to be able to use this formula. A value of 0 indicates that the formula may be used on any number of channels.
        Returns:
        The number of channels or 0
      • getNumFormulas

        public int getNumFormulas()
        Get the number of expression defined by this formula.
      • getFormula

        public String getFormula​(int index)
        Get an expression.
        Parameters:
        index - The index of the expression, starting at 0
        Returns:
        The expression
      • getFormulas

        public List<String> getFormulas()
        Get all expressions as an unmodifiable list.
        Returns:
        A list with the expressions
      • getColoring

        public Coloring getColoring()
        Get coloring information for this formula.
        Returns:
        A Coloring object