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.MZTabColumnFactory
used 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 boolean
equals(Object o)
Class
getDataType()
Get the column data type Class.IndexedElement
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.int
hashCode()
boolean
isOptional()
Judge this column belong to stable column or optional column.void
setElement(IndexedElement 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.String
toString()
-
-
-
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 nonOptionColumn
has 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 nonOptionColumn
has stable order. Column order is used to maintain the logical position inMZTabColumnFactory
id
- 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
,OptionColumn
andParameterOptionColumn
. 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 ofelement
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:
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
,OptionColumn
andParameterOptionColumn
. 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
,OptionColumn
andParameterOptionColumn
. These optional columns need be generated by callingMZTabColumnFactory
's methods.- Specified by:
getOrder
in interfaceIMZTabColumn
- Returns:
- a
String
object. - See Also:
getLogicPosition()
-
setOrder
public void setOrder(String order)
setOrder.
- Specified by:
setOrder
in interfaceIMZTabColumn
- Parameters:
order
- aString
object.
-
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. 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 ofelement
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:
getName()
,setElement(IndexedElement)
,getName()
,setElement(IndexedElement)
-
setHeader
public void setHeader(String header)
setHeader.
- Specified by:
setHeader
in interfaceIMZTabColumn
- Parameters:
header
- aString
object.
-
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
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
,OptionColumn
andParameterOptionColumn
. These optional columns need be generated by callingMZTabColumnFactory
's methods.Notice: in
MZTabColumnFactory
, we use logical position to maintain the logical consistence within theMzTab
file. 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:
getOrder()
-
setLogicPosition
public void setLogicPosition(String logicPosition)
setLogicPosition.
- Specified by:
setLogicPosition
in interfaceIMZTabColumn
- Parameters:
logicPosition
- aString
object.
-
getDataType
public Class getDataType()
Get the column data type Class. Get the column data type Class.- Specified by:
getDataType
in interfaceIMZTabColumn
- Returns:
- a
Class
object.
-
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:
isOptional
in 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
,OptionColumn
andParameterOptionColumn
. 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
,OptionColumn
andParameterOptionColumn
. These optional columns need be generated by callingMZTabColumnFactory
's methods.- Specified by:
getElement
in interfaceIMZTabColumn
- Returns:
- a
IndexedElement
object. - 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
,OptionColumn
andParameterOptionColumn
. 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
,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:
getHeader()
,getLogicPosition()
,getHeader()
,getLogicPosition()
-
-