|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.basedb.core.BasicItem<D> net.sf.basedb.core.OwnedItem<D> net.sf.basedb.core.SharedItem<D> net.sf.basedb.core.CommonItem<FormulaData> net.sf.basedb.core.Formula
public class Formula
This class represents a formula. Formulas can be used for various things such as calculating the spot intensities from raw data or filtering bioassay sets.
Nested Class Summary | |
---|---|
static class |
Formula.AverageMethod
The average method used for the values of this formula. |
static class |
Formula.Parser
The parser used to parse the formula. |
static class |
Formula.Type
The type of formula indicats in which situations it can be used. |
Field Summary | |
---|---|
private Coloring |
coloring
|
static int |
MAX_FORMULA_LENGTH
The maximum length of the formula that can be stored in the database. |
static Item |
TYPE
The type of item represented by this class. |
Fields inherited from interface net.sf.basedb.core.Nameable |
---|
MAX_DESCRIPTION_LENGTH, MAX_NAME_LENGTH |
Constructor Summary | |
---|---|
Formula(FormulaData formulaData)
|
Method Summary | |
---|---|
Formula.AverageMethod |
getAverageMethod()
Get the average method for this formula. |
static Formula |
getById(DbControl dc,
int id)
Get a Formula item when you know the ID. |
int |
getChannels()
Get the number of channels required to be able to use this formula. |
Coloring |
getColoring()
Get coloring information for this formula. |
Date |
getEntryDate()
Get the date that the item was registered in the database. |
String |
getFormula(int index)
Get an expression. |
List<String> |
getFormulas()
Get all expressions as an unmodifiable list. |
Formula.Type |
getFormulaType()
Get the type of formula. |
static Formula |
getNew(DbControl dc)
Create a new Formula item. |
int |
getNumFormulas()
Get the number of expression defined by this formula. |
Formula.Parser |
getParser()
Get the parser that converts the formula to an expresion or restriction. |
static ItemQuery<Formula> |
getQuery()
Get a new query object for this class. |
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. |
RawDataType |
getRawDataType()
Get the raw data type this formula can be used on. |
IntensityTransform |
getResultIntensityTransform()
Get the spot intensity transformation that this formula generates. |
IntensityTransform |
getSourceIntensityTransform()
Get the intensity transformation that is required on spot data if this formula should generate the correct result. |
Item |
getType()
Get the type of item represented by the object. |
Type |
getValueType()
Get the type of values that this formula produces. |
void |
setAverageMethod(Formula.AverageMethod averageMethod)
Set the average method of the formula. |
void |
setChannels(int channels)
Set the number of channels that are required to use this formula. |
void |
setFormulas(List<String> formulas)
Set the expressions used by this formula. |
void |
setFormulaType(Formula.Type type)
Set the type of the formula. |
void |
setParser(Formula.Parser parser)
Set the parser used to convert the formula to an expression or restriction. |
void |
setRawDataType(RawDataType rawDataType)
Set the raw data type this formula can be used on. |
void |
setResultIntensityTransform(IntensityTransform transform)
Sets the transform that this formula generates. |
void |
setSourceIntensityTransform(IntensityTransform transform)
Sets the transform that is required on spot data if this formula should generate the correct result. |
void |
setValueType(Type valueType)
Set the type of the values that this formula produces. |
(package private) void |
validate()
This method is called on each Validatable item
before is saved to the database. |
static ItemQuery<Formula> |
xgetQuery(Formula.Type type,
RawDataType rawDataType)
Deprecated. In 2.12. Use getQuery(Type, RawDataType, IntensityTransform) instead |
Methods inherited from class net.sf.basedb.core.CommonItem |
---|
getDescription, getName, isRemoved, setDescription, setName, setRemoved, toTransferable |
Methods inherited from class net.sf.basedb.core.SharedItem |
---|
getItemKey, getProjectKey, initPermissions, isShared, onBeforeCommit, setItemKey, setProjectKey, toTransferable |
Methods inherited from class net.sf.basedb.core.OwnedItem |
---|
getOwner, isOwner, setOwner, takeOwnership, toTransferable |
Methods inherited from class net.sf.basedb.core.BasicItem |
---|
addUsingItems, addUsingItems, checkPermission, equals, getData, getDbControl, getId, getPermissions, getPluginPermissions, getSessionControl, getUsingItems, getVersion, hashCode, hasPermission, isDetached, isInDatabase, isUsed, onAfterCommit, onAfterInsert, onRollback, setDbControl, setProjectDefaults, toString, toTransferable |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface net.sf.basedb.core.Identifiable |
---|
getId, getVersion |
Methods inherited from interface net.sf.basedb.core.AccessControlled |
---|
checkPermission, getPermissions, hasPermission |
Methods inherited from interface net.sf.basedb.core.Ownable |
---|
getOwner, isOwner, setOwner, takeOwnership |
Field Detail |
---|
public static final Item TYPE
Item.CLIENT
,
getType()
public static final int MAX_FORMULA_LENGTH
setFormulas(List)
method to avoid
exceptions.
private Coloring coloring
Constructor Detail |
---|
Formula(FormulaData formulaData)
Method Detail |
---|
public static Formula getNew(DbControl dc) throws BaseException
Formula
item.
dc
- The DbControl
which will be used for
permission checking and database access
Formula
item
BaseException
- If there is an errorpublic static Formula getById(DbControl dc, int id) throws ItemNotFoundException, PermissionDeniedException, BaseException
Formula
item when you know the ID.
dc
- The DbControl
which will be used for
permission checking and database access.id
- The ID of the item to load
Formula
item
ItemNotFoundException
- If an item with the specified
ID is not found
PermissionDeniedException
- If the logged in user doesn't
have Permission.READ
permission to the item
BaseException
- If there is another errorpublic static ItemQuery<Formula> getQuery()
ItemQuery
objectpublic static ItemQuery<Formula> xgetQuery(Formula.Type type, RawDataType rawDataType)
getQuery(Type, RawDataType, IntensityTransform)
instead
public static ItemQuery<Formula> getQuery(Formula.Type type, RawDataType rawDataType, IntensityTransform source)
type
- The type of formula to return, or null to return any typerawDataType
- The raw data type the formula should be useful for,
or null to not filter on the raw data typesource
- 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.
ItemQuery
objectpublic Item getType()
Identifiable
Item
enumeration.
getType
in interface Identifiable
public Date getEntryDate()
Registered
getEntryDate
in interface Registered
void validate() throws InvalidDataException, BaseException
BasicItem
Validatable
item
before is saved to the database. If the subclass
overrides this method it should also propagate the call
to the superclass, ie. super.validate()
.
validate
in class BasicItem<FormulaData>
BaseException
- If there is an error
InvalidDataException
Formula.Type.validate(Formula)
public Formula.AverageMethod getAverageMethod()
Formula.AverageMethod
objectpublic void setAverageMethod(Formula.AverageMethod averageMethod) throws PermissionDeniedException, InvalidDataException
averageMethod
- A Formula.AverageMethod
object, null is not allowed
PermissionDeniedException
- If the logged in user doesn't have
write permission
InvalidDataException
- If the averageMethod is nullpublic Formula.Type getFormulaType()
Type
objectpublic void setFormulaType(Formula.Type type) throws PermissionDeniedException, InvalidDataException
type
- A Type
object, null is not allowed
PermissionDeniedException
- If the logged in user doesn't have
write permission
InvalidDataException
- If the type is nullpublic Type getValueType()
Type
object, or null if not knownpublic void setValueType(Type valueType) throws PermissionDeniedException, InvalidDataException
Formula.Type.COLUMN_EXPRESSION
formulas that can have a free value type.
Calls to this method are ignored for other formula types.
valueType
- A Type
object, or null if not known
PermissionDeniedException
- If the logged in user doesn't have
write permission
InvalidDataException
public Formula.Parser getParser()
Formula.Parser
objectpublic void setParser(Formula.Parser parser) throws PermissionDeniedException
parser
- The Formula.Parser
object, null is not allowed
PermissionDeniedException
- If the logged in user doesn't have
write permission
InvalidDataException
- If the parser is nullpublic IntensityTransform getSourceIntensityTransform()
public void setSourceIntensityTransform(IntensityTransform transform)
transform
- The required transform or null if the formula works
with all kind of datapublic IntensityTransform getResultIntensityTransform()
public void setResultIntensityTransform(IntensityTransform transform)
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 allpublic RawDataType getRawDataType()
RawDataType
objectpublic void setRawDataType(RawDataType rawDataType) throws PermissionDeniedException
rawDataType
- The raw data type, or null
PermissionDeniedException
- If the logged in user doesn't have
write permissionpublic int getChannels()
public void setChannels(int channels) throws PermissionDeniedException, InvalidDataException
channels
- The number of channels or 0
PermissionDeniedException
- If the logged in user doesn't have
write permission
InvalidDataException
- If the value is negativepublic int getNumFormulas()
public String getFormula(int index)
index
- The index of the expression, starting at 0
public void setFormulas(List<String> formulas) throws InvalidDataException
formulas
- The list of expressions
InvalidDataException
InvalidUseOfNullException
- If the list is null or empty or if
an individual element in the list is null
PermissionDeniedException
- If the logged in user doesn't have
write permissionpublic List<String> getFormulas()
public Coloring getColoring()
Coloring
object
|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |