public class ExtraValueType extends BasicItem implements Nameable, Removable, Registered
BioAssaySet
. All
extra value types must have a unique external id that is used for
identification.
Currently only extra values of Type.INT
, Type.FLOAT
and Type.STRING
are supported.
ExtraValue
,
BioAssaySet.getSpotExtraValueBatcher(Class, ExtraValueType, Job)
,
BioAssaySet.getPositionExtraValueBatcher(Class, ExtraValueType, Job)
Modifier and Type | Field and Description |
---|---|
private Coloring |
coloring |
static int |
MAX_EXTERNAL_ID_LENGTH
The maximum length of the external id variable that can be stored in the
database.
|
static Item |
TYPE
The type of item represented by this class.
|
MAX_DESCRIPTION_LENGTH, MAX_NAME_LENGTH
Constructor and Description |
---|
ExtraValueType(ExtraValueTypeData data)
Creates a new extra value type item.
|
Modifier and Type | Method and Description |
---|---|
Formula.AverageMethod |
getAverageMethod()
Get the average method for this extra value type.
|
static ExtraValueType |
getByExternalId(DbControl dc,
String externalId)
Get a
ExtraValueType when you know the external id. |
static ExtraValueType |
getById(DbControl dc,
int id)
Get an
ExtraValueType object when you know the id. |
Coloring |
getColoring()
Get coloring information for this extra value.
|
(package private) ExtraValueTypeData |
getData()
Get the
BasicData object that holds all data for this item. |
String |
getDescription()
Get the description for the item.
|
Date |
getEntryDate()
Get the date that the item was registered in the database.
|
String |
getExternalId()
Get the external id for this
ExtraValueType item. |
String |
getName()
Get the name of the item.
|
static ExtraValueType |
getNew(DbControl dc,
String externalId,
Type valueType)
Create a new
ExtraValue item. |
static ItemQuery<ExtraValueType> |
getQuery()
Get a query configured to retrieve extra value types.
|
User |
getRemovedBy()
Get the user that flagged this item for removal.
|
Item |
getType()
Get the type of item represented by the object.
|
Set<ItemProxy> |
getUsingItems()
Get all:
ExtraValue :s of this type
|
Type |
getValueType()
Get the value type for this extra value type.
|
boolean |
isRemoved()
Check if the removed flag is set for this item.
|
boolean |
isUsed()
Check if:
Any
ExtraValue :s of this type exists
|
void |
setAverageMethod(Formula.AverageMethod averageMethod)
Set the average method of the extra value type..
|
void |
setDescription(String description)
Set the description for the item.
|
void |
setEntryDate(Date entryDate)
Set the date the entry was registered in the database.
|
void |
setExternalId(String externalId)
Set the external id for this
Client item. |
void |
setName(String name)
Set the name of the item.
|
void |
setRemoved(boolean removed)
Set the removed flag for this item.
|
private void |
setValueType(Type valueType)
Set the value type for this extra value type.
|
addAnnotatableParents, addUsingItems, addUsingItems, breakCircularReferences, checkBatchAnnotatableUsage, checkPermission, equals, getBasicData, getDbControl, getId, getPermissions, getPluginPermissions, getSessionControl, getVersion, hashCode, hasPermission, initPermissions, isDetached, isInDatabase, onAfterCommit, onAfterInsert, onBeforeCommit, onRollback, setDbControl, setProjectDefaults, toString, validate
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getId, getVersion
checkPermission, getPermissions, hasPermission
public static final Item TYPE
Item.EXTRAVALUETYPE
,
getType()
public static final int MAX_EXTERNAL_ID_LENGTH
setExternalId(String)
method to avoid
exceptions.private Coloring coloring
ExtraValueType(ExtraValueTypeData data)
data
- The datapublic static ExtraValueType getNew(DbControl dc, String externalId, Type valueType) throws BaseException
ExtraValue
item. Currently only extra values
of Type.INT
, Type.FLOAT
and Type.STRING
are supported.dc
- The DbControl
which will be used for
permission checking and database accessexternalId
- A unique string identifying the extra value typevalueType
- The Type
of the extra valueExtraValue
itemBaseException
- If there is an errorpublic static ExtraValueType getById(DbControl dc, int id) throws ItemNotFoundException, PermissionDeniedException, BaseException
ExtraValueType
object 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 loadExtraValueType
itemItemNotFoundException
- If an item with the specified id is not foundPermissionDeniedException
- If the logged in user doesn't have
Permission.READ
permission to the itemsBaseException
- If there is an errorpublic static ExtraValueType getByExternalId(DbControl dc, String externalId) throws ItemNotFoundException, PermissionDeniedException, BaseException
ExtraValueType
when you know the external id.dc
- The DbControl
which will be used for
database access.externalId
- The external id of the extra value type to loadExtraValueType
itemItemNotFoundException
- If an item with the specified
id is not foundPermissionDeniedException
- If the logged in user doesn't
have read permission to the itemBaseException
- If there is another errorpublic static ItemQuery<ExtraValueType> getQuery()
ItemQuery
objectExtraValueTypeData getData()
BasicItem
BasicData
object that holds all data for this item.public Item getType()
Identifiable
Item
enumeration.getType
in interface Identifiable
public String getName()
Nameable
public void setName(String name) throws PermissionDeniedException, InvalidDataException
Nameable
Nameable.MAX_NAME_LENGTH
constant.setName
in interface Nameable
name
- The new name for the itemPermissionDeniedException
- If the logged in user doesn't
have write permissionInvalidDataException
- If the name is null or longer
than specified by the Nameable.MAX_NAME_LENGTH
constantpublic String getDescription()
Nameable
getDescription
in interface Nameable
String
with a description of the itempublic void setDescription(String description) throws PermissionDeniedException, InvalidDataException
Nameable
Nameable.MAX_DESCRIPTION_LENGTH
constant.setDescription
in interface Nameable
description
- The new description for the itemPermissionDeniedException
- If the logged in user doesn't
have write permissionInvalidDataException
- If the description longer
than specified by the Nameable.MAX_DESCRIPTION_LENGTH
constantpublic boolean isRemoved()
Removable
public void setRemoved(boolean removed) throws PermissionDeniedException
Removable
setRemoved
in interface Removable
removed
- TRUE if the item should be flagged as removed,
FALSE otherwisePermissionDeniedException
- If the logged in user doesn't
have Permission.DELETE
permission for setting the flag
to TRUE or Permission.WRITE
permission for setting the
flag to FALSEpublic User getRemovedBy() throws PermissionDeniedException, ItemNotFoundException
Removable
getRemovedBy
in interface Removable
PermissionDeniedException
- If the logged in user doesn't have
Permission.READ
permission for the userItemNotFoundException
- If the user that removed this item
can't be foundpublic Date getEntryDate()
Registered
getEntryDate
in interface Registered
public void setEntryDate(Date entryDate)
Registered
setEntryDate
in interface Registered
entryDate
- A date or null to use today's datepublic boolean isUsed() throws BaseException
ExtraValue
:s of this type exists
isUsed
in class BasicItem
BaseException
- If not able to tell if item is used or not.BasicItem.getUsingItems()
public Set<ItemProxy> getUsingItems()
ExtraValue
:s of this type
getUsingItems
in class BasicItem
BasicItem.addUsingItems(Set, Item, org.hibernate.Query)
public Type getValueType()
private void setValueType(Type valueType) throws InvalidDataException
InvalidDataException
VirtualColumn.extraValue(Type)
public String getExternalId()
ExtraValueType
item.public void setExternalId(String externalId) throws PermissionDeniedException, InvalidDataException
Client
item. The value
cannot be null and must not be longer than the value specified by
the MAX_EXTERNAL_ID_LENGTH
constant.externalId
- The new external id for this itemPermissionDeniedException
- If the logged in user doesn't have
write permissionInvalidDataException
- If the new value is null or longer than
MAX_EXTERNAL_ID_LENGTH
public Coloring getColoring()
Coloring
objectpublic Formula.AverageMethod getAverageMethod()
Formula.AverageMethod
objectpublic void setAverageMethod(Formula.AverageMethod averageMethod) throws PermissionDeniedException, InvalidDataException
averageMethod
- A Formula.AverageMethod
object, null is not allowedPermissionDeniedException
- If the logged in user doesn't have
write permissionInvalidDataException
- If the averageMethod is null