Package uk.ac.ebi.pride.jmztab2.model
Class SmallMoleculeEvidenceColumn
- java.lang.Object
-
- uk.ac.ebi.pride.jmztab2.model.SmallMoleculeEvidenceColumn
-
- All Implemented Interfaces:
IMZTabColumn
,ISmallMoleculeColumn
,ISmallMoleculeEvidenceColumn
public class SmallMoleculeEvidenceColumn extends Object implements ISmallMoleculeEvidenceColumn
Define the stable columns which have stable order in the small molecule evidence header line. Refactored to contain an enum for stable columns.- Since:
- 11/09/17
- Author:
- nilshoffmann
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SmallMoleculeEvidenceColumn.Stable
StableSmallMoleculeEvidenceColumn
definition templates.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Class<?>
getDataType()
Get the column data type Class.Object
getElement()
Indexed element used in optional column header and logical position definition.String
getHeader()
Get the column name.String
getLogicPosition()
Get the column logical position.String
getName()
Get the column name.String
getOrder()
Get the column internal order.boolean
isOptional()
Judge this column belong to stable column or optional column.void
setElement(Object element)
Indexed element used in optional column header and logical position definition.void
setHeader(String header)
setHeader.void
setLogicPosition(String logicPosition)
setLogicPosition.void
setOrder(String order)
setOrder.
-
-
-
Method Detail
-
getDataType
public Class<?> getDataType()
Get the column data type Class.- Specified by:
getDataType
in interfaceIMZTabColumn
- Returns:
- a
Class
object.
-
getElement
public Object getElement()
Indexed element used in optional column header and logical position definition. In stable column, the return is null. Notice: this design pattern not fit forAbundanceColumn
,OptionColumn
andParameterOptionColumn
. These optional columns need be generated by callingMZTabColumnFactory
's methods.- Specified by:
getElement
in interfaceIMZTabColumn
- Returns:
- a
IndexedElement
object. - See Also:
IMZTabColumn.getHeader()
,IMZTabColumn.getLogicPosition()
,IMZTabColumn.getHeader()
,IMZTabColumn.getLogicPosition()
-
getHeader
public String getHeader()
Get the column name. For stable column, name and header are same. While for optional column, name is part of its header. For example, optional column which header is search_engine_score_ms_run[1-n], and its name is search_engine_score. Besides this, ms_run[1-n] is kind ofIMZTabColumn.getElement()
Notice: this design pattern not fit forAbundanceColumn
,OptionColumn
andParameterOptionColumn
. These optional columns need be generated by callingMZTabColumnFactory
's methods.- Specified by:
getHeader
in interfaceIMZTabColumn
- Returns:
- a
String
object. - See Also:
IMZTabColumn.getName()
,#setElement(IndexedElement)
,IMZTabColumn.getName()
,#setElement(IndexedElement)
-
getLogicPosition
public String getLogicPosition()
Get the column logical position. For stable column, order and logical position are same. But for optional column, the logical position need to calculate by concatenate order and index element id. For example, optional column search_engine_score_ms_run[2] in Protein section, its order is 09, and the logical position is 092. Because the element ms_run[2] 's index is 2.Notice: this design pattern not fit for
AbundanceColumn
,OptionColumn
andParameterOptionColumn
. These optional columns need be generated by callingMZTabColumnFactory
's methods.Notice: in
MZTabColumnFactory
, we use logical position to maintain the logical consistence with inMzTab
. During the process of parsing mzTab file, we create a mapping between physical position and internal logical position.- Specified by:
getLogicPosition
in interfaceIMZTabColumn
- Returns:
- a
String
object. - See Also:
IMZTabColumn.getOrder()
-
getName
public String getName()
Get the column name. For stable column, name and header are same. But for optional column, name is part of its header. For example, optional column which header is search_engine_score_ms_run[1-n], and its name is search_engine_score. Besides this, ms_run[1-n] is kind ofIMZTabColumn.getElement()
Notice: this design pattern not fit forAbundanceColumn
,OptionColumn
andParameterOptionColumn
. These optional columns need be generated by callingMZTabColumnFactory
's methods.- Specified by:
getName
in interfaceIMZTabColumn
- Returns:
- a
String
object. - See Also:
IMZTabColumn.getHeader()
,#setElement(IndexedElement)
,IMZTabColumn.getHeader()
,#setElement(IndexedElement)
-
getOrder
public String getOrder()
Get the column internal order. For stable column, order and logical position are same. But for optional column, the logical position need to be calculated by concatenating order and index element id. For example, optional column search_engine_score_ms_run[2] in Protein section, its order is 09, and the logical position is 092. Because the element ms_run[2] 's index is 2. Notice: this design pattern not fit forAbundanceColumn
,OptionColumn
andParameterOptionColumn
. These optional columns need be generated by callingMZTabColumnFactory
's methods.- Specified by:
getOrder
in interfaceIMZTabColumn
- Returns:
- a
String
object. - See Also:
IMZTabColumn.getLogicPosition()
-
isOptional
public boolean isOptional()
Judge this column belong to stable column or optional column.- Specified by:
isOptional
in interfaceIMZTabColumn
- Returns:
- a boolean.
-
setHeader
public void setHeader(String header)
setHeader.
- Specified by:
setHeader
in interfaceIMZTabColumn
- Parameters:
header
- aString
object.
-
setLogicPosition
public void setLogicPosition(String logicPosition)
setLogicPosition.
- Specified by:
setLogicPosition
in interfaceIMZTabColumn
- Parameters:
logicPosition
- aString
object.
-
setOrder
public void setOrder(String order)
setOrder.
- Specified by:
setOrder
in interfaceIMZTabColumn
- Parameters:
order
- aString
object.
-
setElement
public void setElement(Object element)
Indexed element used in optional column header and logical position definition. In stable column, the return is null. Notice: this design pattern not fit forAbundanceColumn
,OptionColumn
andParameterOptionColumn
. These optional columns need be generated by callingMZTabColumnFactory
's methods.- Specified by:
setElement
in interfaceIMZTabColumn
- Parameters:
element
- SHOULD NOT set null.- See Also:
IMZTabColumn.getHeader()
,IMZTabColumn.getLogicPosition()
,IMZTabColumn.getHeader()
,IMZTabColumn.getLogicPosition()
-
-