Package de.isas.lipidomics.domain
Enum Element
- java.lang.Object
-
- java.lang.Enum<Element>
-
- de.isas.lipidomics.domain.Element
-
- All Implemented Interfaces:
Serializable,Comparable<Element>
public enum Element extends Enum<Element>
Enumeration for typical chemical elements in lipids. Also supports heavy variants, e.g. C' as the heavy C13 isotope.- Author:
- nils.hoffmann
-
-
Enum Constant Summary
Enum Constants Enum Constant Description ELEMENT_CCarbon 12CELEMENT_C13Heavy carbon 13CELEMENT_HHydrogen 1HELEMENT_H2Deuterium 2HELEMENT_NNitrogen 14NELEMENT_N15Heavy nitrogen 15NELEMENT_OOxygen 15OELEMENT_O17Heavy oxygen 17OELEMENT_O18Heavy oxygen 18OELEMENT_PPhosphorous 30PELEMENT_P32Heavy phosphorus 32PELEMENT_SSulfur 31SELEMENT_S33Heavy sulfur 33SELEMENT_S34Heavy sulfur 34S
-
Field Summary
Fields Modifier and Type Field Description static doubleELECTRON_REST_MASS
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Optional<Element>forName(String name)Tries to find the corresponding element by name, e.g.StringgetAlias()doublegetMass()StringgetName()intgetOrder()static ElementvalueOf(String name)Returns the enum constant of this type with the specified name.static Element[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
ELEMENT_H2
public static final Element ELEMENT_H2
Deuterium 2H
-
ELEMENT_C13
public static final Element ELEMENT_C13
Heavy carbon 13C
-
ELEMENT_N15
public static final Element ELEMENT_N15
Heavy nitrogen 15N
-
ELEMENT_O17
public static final Element ELEMENT_O17
Heavy oxygen 17O
-
ELEMENT_O18
public static final Element ELEMENT_O18
Heavy oxygen 18O
-
ELEMENT_P32
public static final Element ELEMENT_P32
Heavy phosphorus 32P
-
ELEMENT_S33
public static final Element ELEMENT_S33
Heavy sulfur 33S
-
ELEMENT_S34
public static final Element ELEMENT_S34
Heavy sulfur 34S
-
-
Field Detail
-
ELECTRON_REST_MASS
public static final double ELECTRON_REST_MASS
- See Also:
- Constant Field Values
-
-
Method Detail
-
values
public static Element[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (Element c : Element.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static Element valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
getMass
public double getMass()
-
getOrder
public int getOrder()
-
forName
public static Optional<Element> forName(String name)
Tries to find the corresponding element by name, e.g. 'C' would return carbon, while '13C' would return the corresponding carbon isotope. Note that 'C'' is an alias for 13C.- Parameters:
name- the name of the chemical element.- Returns:
- the corresponding element, if it exists. It not, an empty optional will be returned.
-
-