Class MZTabColumn
- java.lang.Object
-
- uk.ac.ebi.pride.jmztab2.model.MZTabColumn
-
- All Implemented Interfaces:
IMZTabColumn
- Direct Known Subclasses:
AbundanceColumn,OptionColumn
public class MZTabColumn extends Object implements IMZTabColumn
Define a column header which used inSection.Protein_Header,Section.Peptide_Header,Section.PSM_Header, orSection.Small_Molecule_Header. There are two kinds of columns: stable column and optional column. Stable column has stable position and header name, while optional column not.MZTabColumnFactoryused to create and maintain these column objects.- Since:
- 23/05/13
- Author:
- qingwei, nilshoffmann
- See Also:
MZTabColumnFactory,SmallMoleculeColumn,SmallMoleculeFeatureColumn,SmallMoleculeEvidenceColumn,OptionColumn,ParameterOptionColumn,AbundanceColumn
-
-
Constructor Summary
Constructors Constructor Description MZTabColumn(String name, Class dataType, boolean optional, String order)Create a column header object.MZTabColumn(String name, Class dataType, boolean optional, String order, Integer id)Create a column header object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)ClassgetDataType()Get the column data type Class.IndexedElementgetElement()Indexed element used in optional column header and logical position definition.StringgetHeader()Get the column name.StringgetLogicPosition()Get the column logical position.StringgetName()Get the column name.StringgetOrder()Get the column internal order.inthashCode()booleanisOptional()Judge this column belong to stable column or optional column.voidsetElement(IndexedElement element)Indexed element used in optional column header and logical position definition.voidsetHeader(String header)setHeader.voidsetLogicPosition(String logicPosition)setLogicPosition.voidsetOrder(String order)setOrder.StringtoString()
-
-
-
Constructor Detail
-
MZTabColumn
public MZTabColumn(String name, Class dataType, boolean optional, String order)
Create a column header object. Default, the column header keep the same value with name, and logical position keep the same value with order.- Parameters:
name- define a stable name for column. For optional column, only set stable part for name.dataType- define the data type for column.optional- if false the column is stable type, otherwise is optional column.order- internal order. Every nonOptionColumnhas stable order. Column order is used to maintain the logical position inMZTabColumnFactory
-
MZTabColumn
public MZTabColumn(String name, Class dataType, boolean optional, String order, Integer id)
Create a column header object. Default, the column header keep the same value with name, and logical position keep the same value with order.- Parameters:
name- define a stable name for column. For optional column, only set stable part for name.dataType- define the data type for column.optional- if false the column is stable type, otherwise is optional column.order- internal order. Every nonOptionColumnhas stable order. Column order is used to maintain the logical position inMZTabColumnFactoryid- incremental index used for some optional columns like best_search_engine_score[1], best_search_engine_score[2]
-
-
Method Detail
-
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,OptionColumnandParameterOptionColumn. These optional columns need be generated by callingMZTabColumnFactory's methods. 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 ofelementNotice: this design pattern not fit forAbundanceColumn,OptionColumnandParameterOptionColumn. These optional columns need be generated by callingMZTabColumnFactory's methods.- Specified by:
getNamein interfaceIMZTabColumn- Returns:
- a
Stringobject. - See Also:
getHeader(),setElement(IndexedElement),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,OptionColumnandParameterOptionColumn. These optional columns need be generated by callingMZTabColumnFactory's methods. 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,OptionColumnandParameterOptionColumn. These optional columns need be generated by callingMZTabColumnFactory's methods.- Specified by:
getOrderin interfaceIMZTabColumn- Returns:
- a
Stringobject. - See Also:
getLogicPosition()
-
setOrder
public void setOrder(String order)
setOrder.
- Specified by:
setOrderin interfaceIMZTabColumn- Parameters:
order- aStringobject.
-
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,OptionColumnandParameterOptionColumn. These optional columns need be generated by callingMZTabColumnFactory's methods. 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 ofelementNotice: this design pattern not fit forAbundanceColumn,OptionColumnandParameterOptionColumn. These optional columns need be generated by callingMZTabColumnFactory's methods.- Specified by:
getHeaderin interfaceIMZTabColumn- Returns:
- a
Stringobject. - See Also:
getName(),setElement(IndexedElement),getName(),setElement(IndexedElement)
-
setHeader
public void setHeader(String header)
setHeader.
- Specified by:
setHeaderin interfaceIMZTabColumn- Parameters:
header- aStringobject.
-
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,OptionColumnandParameterOptionColumn. These optional columns need be generated by callingMZTabColumnFactory's methods.Notice: in
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.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.Notice: this design pattern not fit for
AbundanceColumn,OptionColumnandParameterOptionColumn. These optional columns need be generated by callingMZTabColumnFactory's methods.Notice: in
MZTabColumnFactory, we use logical position to maintain the logical consistence within theMzTabfile. During the process of parsing mzTab file, we create a mapping between physical position and internal logical position.- Specified by:
getLogicPositionin interfaceIMZTabColumn- Returns:
- a
Stringobject. - See Also:
getOrder()
-
setLogicPosition
public void setLogicPosition(String logicPosition)
setLogicPosition.
- Specified by:
setLogicPositionin interfaceIMZTabColumn- Parameters:
logicPosition- aStringobject.
-
getDataType
public Class getDataType()
Get the column data type Class. Get the column data type Class.- Specified by:
getDataTypein interfaceIMZTabColumn- Returns:
- a
Classobject.
-
isOptional
public boolean isOptional()
Judge this column belong to stable column or optional column. Judge this column belong to stable column or optional column.- Specified by:
isOptionalin interfaceIMZTabColumn- Returns:
- a boolean.
-
getElement
public IndexedElement 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,OptionColumnandParameterOptionColumn. These optional columns need be generated by callingMZTabColumnFactory's methods. 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,OptionColumnandParameterOptionColumn. These optional columns need be generated by callingMZTabColumnFactory's methods.- Specified by:
getElementin interfaceIMZTabColumn- Returns:
- a
IndexedElementobject. - See Also:
getHeader(),getLogicPosition(),getHeader(),getLogicPosition()
-
setElement
public void setElement(IndexedElement 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,OptionColumnandParameterOptionColumn. These optional columns need be generated by callingMZTabColumnFactory's methods. 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,OptionColumnandParameterOptionColumn. These optional columns need be generated by callingMZTabColumnFactory's methods.- Specified by:
setElementin interfaceIMZTabColumn- Parameters:
element- SHOULD NOT set null.- See Also:
getHeader(),getLogicPosition(),getHeader(),getLogicPosition()
-
-