Package moss
Class AtomTypeMgr
java.lang.Object
moss.TypeMgr
moss.AtomTypeMgr
- All Implemented Interfaces:
Serializable
Class for an atom type manager.
- Since:
- 2007.06.20
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
Ac Actiniumstatic final int
Al Aluminumstatic final int
Am Americumstatic final int
Sb Antimonystatic final int
Ar Argonstatic final int
the flag indicating whether an atom is part of an aromatic ringstatic final int
As Arsenicstatic final int
At Astatinestatic final int
Ba Bariumstatic final int
Bk Berkeliumstatic final int
Be Berylliumstatic final int
Bi Bismuthstatic final int
Bh Bohriumstatic final int
B Boronstatic final int
Br Brominestatic final int
Cd Cadmiumstatic final int
Ca Calciumstatic final int
Cf Californiumstatic final int
C Carbonstatic final int
Ce Ceriumstatic final int
Cs Cesiumstatic final int
the mask for extracting the charge from an atom typestatic final int
the shift value for extracting the charge from an atom typestatic final int
Cl Chlorinestatic final int
Cr Chromiumstatic final int
Co Cobaltstatic final int
Cn Coperniciumstatic final int
Cu Copperstatic final int
Cm Curiumstatic final int
Ds Darmstadtiumstatic final int
Db Dubniumstatic final int
Dy Dysprosiumstatic final int
Es Einsteiniumstatic final int
the number of chemical elements (not all actually exist)protected static final String[]
the periodic table of elements; using the chemical element as an index for this table yields a printable element namestatic final int
the mask for the chemical element of an atomstatic final int
Er Erbiumstatic final int
Eu Europiumstatic final int
Fm Fermiumstatic final int
F Flourinestatic final int
Fr Franciumstatic final int
Gd Gadoliniumstatic final int
Ga Galliumstatic final int
Ge Germaniumstatic final int
Au Goldstatic final int
Hf Hafniumstatic final int
Hs Hassiumstatic final int
He Heliumstatic final int
Ho Holmiumstatic final int
H Hydrogenstatic final int
the mask for extracting the hydrogens from an atom typestatic final int
the shift value for extracting the hydrogens from an atom typestatic final int
In Indiumstatic final int
I Iodinestatic final int
Ir Iridiumstatic final int
Fe Ironstatic final int
Kr Kryptonstatic final int
La Lanthaniumstatic final int
Lr Lawrenciumstatic final int
Pb Leadstatic final int
Li Lithiumstatic final int
Lu Lutetiumstatic final int
Mg Magnesiumstatic final int
Mn Manganeseprotected static int[][]
the map from element names (character pairs) to element codesstatic final int
Mt Meitneriumstatic final int
Md Mendeleviumstatic final int
Hg Mercurystatic final int
Mo Molybdenumstatic final int
Nd Neodymiumstatic final int
Ne Neonstatic final int
Np Neptuniumstatic final int
Ni Nickelstatic final int
Nb Niobiumstatic final int
N Nitrogenstatic final int
No Nobeliumstatic final int
nullstatic final int
Os Osmiumstatic final int
O Oxygenstatic final int
Pd Palladiumstatic final int
P Phosphorusstatic final int
Pt Platinumstatic final int
Pu Plutoniumstatic final int
Po Poloniumstatic final int
K Potassiumstatic final int
Pr Praseodyniumstatic final int
Pm Promethiumstatic final int
Pa Proactiniumstatic final int
Ra Radiumstatic final int
Rn Radonstatic final int
Re Rheniumstatic final int
Rh Rhodiumstatic final int
Rg Roentgeniumstatic final int
Rb Rubidiumstatic final int
Ru Rutheniumstatic final int
Rf Rutherfordiumstatic final int
Sm Samariumstatic final int
Sc Scandiumstatic final int
Sg Seaborgiumstatic final int
Se Seleniumstatic final int
Si Siliconstatic final int
Ag Silverstatic final int
Na Sodiumstatic final int
Sr Strontiumstatic final int
S Sulfurstatic final int
Ta Tantalumstatic final int
Tc Technetiumstatic final int
Te Telluriumstatic final int
Tb Terbiumstatic final int
Tl Thalliumstatic final int
Th Thoriumstatic final int
Tm Thuliumstatic final int
Sn Tinstatic final int
Ti Titaniumstatic final int
W Tungstenstatic final int
atom type: unknownstatic final int
U Uraniumstatic final int
V Vanadiumstatic final int
Xe Xenonstatic final int
Yb Ytterbiumstatic final int
Y Yttriumstatic final int
Zn Zincstatic final int
Zr Zirconium -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
Add an atom type.static int
codeCharge
(int chg) Encode a charge for addition to an atom type.static int
codeHydros
(int n) Encode hydrogens for addition to an atom type.static String
Get the name of a chain atom.static int
getCharge
(int type) Extract the charge from an atom type.int
Map an atom name to the corresponding code.static int
getElem
(int type) Extract the chemical element from an atom type.static String
getElemName
(int type) Extract the name of a chemical element from an atom type.static int
getHydros
(int type) Extract the hydrogens from an atom type.getName
(int code) Map a code to the corresponding atom name.int
Get the number of managed types.static String
Get the name of a wildcard atom.static boolean
isAromatic
(int type) Check whether an atom type specifies an aromatic atom.static boolean
isChain
(int type) Check whether an atom type specifies a chain atom.boolean
isFixed()
Check whether a type manager is fixed (is not extendable).static void
Main function for testing some basic functionality.static int
removeCharge
(int type) Remove the charge from an atom type.static int
removeExts
(int type) Remove the extended information from an atom type.static int
removeHydros
(int type) Remove the hydrogens from an atom type.Methods inherited from class moss.TypeMgr
getBase, isSpecial, isWildcard
-
Field Details
-
UNKNOWN
public static final int UNKNOWNatom type: unknown- See Also:
-
NULL
public static final int NULLnull- See Also:
-
HYDROGEN
public static final int HYDROGENH Hydrogen- See Also:
-
HELIUM
public static final int HELIUMHe Helium- See Also:
-
LITHIUM
public static final int LITHIUMLi Lithium- See Also:
-
BERYLLIUM
public static final int BERYLLIUMBe Beryllium- See Also:
-
BORON
public static final int BORONB Boron- See Also:
-
CARBON
public static final int CARBONC Carbon- See Also:
-
NITROGEN
public static final int NITROGENN Nitrogen- See Also:
-
OXYGEN
public static final int OXYGENO Oxygen- See Also:
-
FLOURINE
public static final int FLOURINEF Flourine- See Also:
-
NEON
public static final int NEONNe Neon- See Also:
-
SODIUM
public static final int SODIUMNa Sodium- See Also:
-
MAGNESIUM
public static final int MAGNESIUMMg Magnesium- See Also:
-
ALUMINUM
public static final int ALUMINUMAl Aluminum- See Also:
-
SILICON
public static final int SILICONSi Silicon- See Also:
-
PHOSPHORUS
public static final int PHOSPHORUSP Phosphorus- See Also:
-
SULFUR
public static final int SULFURS Sulfur- See Also:
-
CHLORINE
public static final int CHLORINECl Chlorine- See Also:
-
ARGON
public static final int ARGONAr Argon- See Also:
-
POTASSIUM
public static final int POTASSIUMK Potassium- See Also:
-
CALCIUM
public static final int CALCIUMCa Calcium- See Also:
-
SCANDIUM
public static final int SCANDIUMSc Scandium- See Also:
-
TITANIUM
public static final int TITANIUMTi Titanium- See Also:
-
VANADIUM
public static final int VANADIUMV Vanadium- See Also:
-
CHROMIUM
public static final int CHROMIUMCr Chromium- See Also:
-
MANGANESE
public static final int MANGANESEMn Manganese- See Also:
-
IRON
public static final int IRONFe Iron- See Also:
-
COBALT
public static final int COBALTCo Cobalt- See Also:
-
NICKEL
public static final int NICKELNi Nickel- See Also:
-
COPPER
public static final int COPPERCu Copper- See Also:
-
ZINC
public static final int ZINCZn Zinc- See Also:
-
GALLIUM
public static final int GALLIUMGa Gallium- See Also:
-
GERMANIUM
public static final int GERMANIUMGe Germanium- See Also:
-
ARSENIC
public static final int ARSENICAs Arsenic- See Also:
-
SELENIUM
public static final int SELENIUMSe Selenium- See Also:
-
BROMINE
public static final int BROMINEBr Bromine- See Also:
-
KRYPTON
public static final int KRYPTONKr Krypton- See Also:
-
RUBIDIUM
public static final int RUBIDIUMRb Rubidium- See Also:
-
STRONTIUM
public static final int STRONTIUMSr Strontium- See Also:
-
YTTRIUM
public static final int YTTRIUMY Yttrium- See Also:
-
ZIRCONIUM
public static final int ZIRCONIUMZr Zirconium- See Also:
-
NIOBIUM
public static final int NIOBIUMNb Niobium- See Also:
-
MOLYBDENUM
public static final int MOLYBDENUMMo Molybdenum- See Also:
-
TECHNETIUM
public static final int TECHNETIUMTc Technetium- See Also:
-
RUTHENIUM
public static final int RUTHENIUMRu Ruthenium- See Also:
-
RHODIUM
public static final int RHODIUMRh Rhodium- See Also:
-
PALLADIUM
public static final int PALLADIUMPd Palladium- See Also:
-
SILVER
public static final int SILVERAg Silver- See Also:
-
CADMIUM
public static final int CADMIUMCd Cadmium- See Also:
-
INDIUM
public static final int INDIUMIn Indium- See Also:
-
TIN
public static final int TINSn Tin- See Also:
-
ANTIMONY
public static final int ANTIMONYSb Antimony- See Also:
-
TELLURIUM
public static final int TELLURIUMTe Tellurium- See Also:
-
IODINE
public static final int IODINEI Iodine- See Also:
-
XENON
public static final int XENONXe Xenon- See Also:
-
CESIUM
public static final int CESIUMCs Cesium- See Also:
-
BARIUM
public static final int BARIUMBa Barium- See Also:
-
LANTHANUM
public static final int LANTHANUMLa Lanthanium- See Also:
-
CERIUM
public static final int CERIUMCe Cerium- See Also:
-
PRASEODYMIUM
public static final int PRASEODYMIUMPr Praseodynium- See Also:
-
NEODYMIUM
public static final int NEODYMIUMNd Neodymium- See Also:
-
PROMETHIUM
public static final int PROMETHIUMPm Promethium- See Also:
-
SAMARIUM
public static final int SAMARIUMSm Samarium- See Also:
-
EUROPIUM
public static final int EUROPIUMEu Europium- See Also:
-
GADOLINIUM
public static final int GADOLINIUMGd Gadolinium- See Also:
-
TERBIUM
public static final int TERBIUMTb Terbium- See Also:
-
DYSPROSIUM
public static final int DYSPROSIUMDy Dysprosium- See Also:
-
HOLMIUM
public static final int HOLMIUMHo Holmium- See Also:
-
ERBIUM
public static final int ERBIUMEr Erbium- See Also:
-
THULIUM
public static final int THULIUMTm Thulium- See Also:
-
YTTERBIUM
public static final int YTTERBIUMYb Ytterbium- See Also:
-
LUTETIUM
public static final int LUTETIUMLu Lutetium- See Also:
-
HAFNIUM
public static final int HAFNIUMHf Hafnium- See Also:
-
TANTALUM
public static final int TANTALUMTa Tantalum- See Also:
-
TUNGSTEN
public static final int TUNGSTENW Tungsten- See Also:
-
RHENIUM
public static final int RHENIUMRe Rhenium- See Also:
-
OSMIUM
public static final int OSMIUMOs Osmium- See Also:
-
IRIDIUM
public static final int IRIDIUMIr Iridium- See Also:
-
PLATINUM
public static final int PLATINUMPt Platinum- See Also:
-
GOLD
public static final int GOLDAu Gold- See Also:
-
MERCURY
public static final int MERCURYHg Mercury- See Also:
-
THALLIUM
public static final int THALLIUMTl Thallium- See Also:
-
LEAD
public static final int LEADPb Lead- See Also:
-
BISMUTH
public static final int BISMUTHBi Bismuth- See Also:
-
POLONIUM
public static final int POLONIUMPo Polonium- See Also:
-
ASTATINE
public static final int ASTATINEAt Astatine- See Also:
-
RADON
public static final int RADONRn Radon- See Also:
-
FRANCIUM
public static final int FRANCIUMFr Francium- See Also:
-
RADIUM
public static final int RADIUMRa Radium- See Also:
-
ACTINIUM
public static final int ACTINIUMAc Actinium- See Also:
-
THORIUM
public static final int THORIUMTh Thorium- See Also:
-
PROTACTINIUM
public static final int PROTACTINIUMPa Proactinium- See Also:
-
URANIUM
public static final int URANIUMU Uranium- See Also:
-
NEPTUNIUM
public static final int NEPTUNIUMNp Neptunium- See Also:
-
PLUTONIUM
public static final int PLUTONIUMPu Plutonium- See Also:
-
AMERICUM
public static final int AMERICUMAm Americum- See Also:
-
CURIUM
public static final int CURIUMCm Curium- See Also:
-
BERKELIUM
public static final int BERKELIUMBk Berkelium- See Also:
-
CALIFORNIUM
public static final int CALIFORNIUMCf Californium- See Also:
-
EINSTEINIUM
public static final int EINSTEINIUMEs Einsteinium- See Also:
-
FERMIUM
public static final int FERMIUMFm Fermium- See Also:
-
MENDELEVIUM
public static final int MENDELEVIUMMd Mendelevium- See Also:
-
NOBELIUM
public static final int NOBELIUMNo Nobelium- See Also:
-
LAWRENCIUM
public static final int LAWRENCIUMLr Lawrencium- See Also:
-
RUTHERFORDIUM
public static final int RUTHERFORDIUMRf Rutherfordium- See Also:
-
DUBNIUM
public static final int DUBNIUMDb Dubnium- See Also:
-
SEABORGIUM
public static final int SEABORGIUMSg Seaborgium- See Also:
-
BOHRIUM
public static final int BOHRIUMBh Bohrium- See Also:
-
HASSIUM
public static final int HASSIUMHs Hassium- See Also:
-
MEITNERIUM
public static final int MEITNERIUMMt Meitnerium- See Also:
-
DARMSTADTIUM
public static final int DARMSTADTIUMDs Darmstadtium- See Also:
-
ROENTGENIUM
public static final int ROENTGENIUMRg Roentgenium- See Also:
-
COPERNICIUM
public static final int COPERNICIUMCn Copernicium- See Also:
-
ELEMCNT
public static final int ELEMCNTthe number of chemical elements (not all actually exist)- See Also:
-
ELEMMASK
public static final int ELEMMASKthe mask for the chemical element of an atom- See Also:
-
AROMATIC
public static final int AROMATICthe flag indicating whether an atom is part of an aromatic ring- See Also:
-
CHARGESHIFT
public static final int CHARGESHIFTthe shift value for extracting the charge from an atom type- See Also:
-
CHARGEMASK
public static final int CHARGEMASKthe mask for extracting the charge from an atom type- See Also:
-
HYDROSHIFT
public static final int HYDROSHIFTthe shift value for extracting the hydrogens from an atom type- See Also:
-
HYDROMASK
public static final int HYDROMASKthe mask for extracting the hydrogens from an atom type- See Also:
-
ELEMENTS
the periodic table of elements; using the chemical element as an index for this table yields a printable element name -
map
protected static int[][] mapthe map from element names (character pairs) to element codes
-
-
Constructor Details
-
AtomTypeMgr
public AtomTypeMgr()Create an atom type manager.- Since:
- 2007.06.21 (Christian Borgelt)
-
-
Method Details
-
isFixed
public boolean isFixed()Check whether a type manager is fixed (is not extendable). -
getTypeCount
public int getTypeCount()Get the number of managed types.- Specified by:
getTypeCount
in classTypeMgr
- Returns:
- the number of types in this type manager
- Since:
- 2020.10.16 (Christian Borgelt)
-
add
Add an atom type.The set of atom types is fixed and cannot be extended. Therefore this function behaves exactly like the function
getCode()
and returns -1 for an unknown name. -
getCode
Map an atom name to the corresponding code. -
getName
Map a code to the corresponding atom name. -
getChainName
Get the name of a chain atom.- Returns:
- the name of a chain atom
- Since:
- 2007.06.22 (Christian Borgelt)
-
getWildcard
Get the name of a wildcard atom.- Returns:
- the name of a wildcard atom
- Since:
- 2007.06.22 (Christian Borgelt)
-
getElem
public static int getElem(int type) Extract the chemical element from an atom type.The chemical element is only part of the type of an atom. The type of an atom also includes an aromatic flag and a possible charge.
- Parameters:
type
- the type from which to extract the chemical element- Returns:
- the chemical element encoded in the given atom type
- Since:
- 2002.03.11 (Christian Borgelt)
-
getElemName
Extract the name of a chemical element from an atom type.- Parameters:
type
- the type from which to extract the chemical element- Returns:
- the name of the chemical element encoded int the type
- Since:
- 2006.10.31 (Christian Borgelt)
-
isChain
public static boolean isChain(int type) Check whether an atom type specifies a chain atom.- Parameters:
type
- the atom type to check- Returns:
- whether the atom type specifies a chain atom
- Since:
- 2009.08.13 (Christian Borgelt)
-
isAromatic
public static boolean isAromatic(int type) Check whether an atom type specifies an aromatic atom.- Parameters:
type
- the atom type to check- Returns:
- whether the atom type is aromatic
- Since:
- 2006.10.31 (Christian Borgelt)
-
codeCharge
public static int codeCharge(int chg) Encode a charge for addition to an atom type.The result of this function has to be combined with an element type using a bitwise and.
- Parameters:
chg
- the charge to encode- Returns:
- the encoded charge
- Since:
- 2002.03.11 (Christian Borgelt)
-
getCharge
public static int getCharge(int type) Extract the charge from an atom type.- Parameters:
type
- the type from which to extract the charge- Returns:
- the charge encoded in the given atom type
- Since:
- 2002.03.11 (Christian Borgelt)
-
removeCharge
public static int removeCharge(int type) Remove the charge from an atom type.- Parameters:
type
- the type from which to remove the charge- Returns:
- the atom type without any charge
- Since:
- 2007.06.22 (Christian Borgelt)
-
codeHydros
public static int codeHydros(int n) Encode hydrogens for addition to an atom type.The result of this function has to be combined with an element type using a bitwise and.
- Parameters:
n
- the number of hydrogens to encode- Returns:
- the encoded number of hydrogens
- Since:
- 2007.06.22 (Christian Borgelt)
-
getHydros
public static int getHydros(int type) Extract the hydrogens from an atom type.- Parameters:
type
- the type from which to extract the hydrogens- Returns:
- the number of hydrogens encoded in the given atom type
- Since:
- 2007.06.22 (Christian Borgelt)
-
removeHydros
public static int removeHydros(int type) Remove the hydrogens from an atom type.- Parameters:
type
- the type from which to remove the hydrogens- Returns:
- the atom type without any hydrogens
- Since:
- 2007.06.22 (Christian Borgelt)
-
removeExts
public static int removeExts(int type) Remove the extended information from an atom type.- Parameters:
type
- the type from which to remove the information- Returns:
- the atom type without extended information
- Since:
- 2007.11.09 (Christian Borgelt)
-
main
Main function for testing some basic functionality.It is tried to parse the first command line argument as an atom description and the resulting code is reported.
- Parameters:
args
- the command line arguments- Since:
- 2007.06.21 (Christian Borgelt)
-