public class AtomTypeMgr extends TypeMgr
Modifier and Type | Field and Description |
---|---|
static int |
ACTINIUM |
static int |
ALUMINUM |
static int |
AMERICUM |
static int |
ANTIMONY |
static int |
ARGON |
static int |
AROMATIC
the flag indicating whether an atom is part of an aromatic ring
|
static int |
ARSENIC |
static int |
ASTATINE |
static int |
BARIUM |
static int |
BERKELIUM |
static int |
BERYLLIUM |
static int |
BISMUTH |
static int |
BOHRIUM |
static int |
BORON |
static int |
BROMINE |
static int |
CADMIUM |
static int |
CALCIUM |
static int |
CALIFORNIUM |
static int |
CARBON |
static int |
CERIUM |
static int |
CESIUM |
static int |
CHARGEMASK
the mask for extracting the charge from an atom type
|
static int |
CHARGESHIFT
the shift value for extracting the charge from an atom type
|
static int |
CHLORINE |
static int |
CHROMIUM |
static int |
COBALT |
static int |
COPERNICIUM |
static int |
COPPER |
static int |
CURIUM |
static int |
DARMSTADTIUM |
static int |
DUBNIUM |
static int |
DYSPROSIUM |
static int |
EINSTEINIUM |
static int |
ELEMCNT
the number of chemical elements (not all actually exist)
|
protected static java.lang.String[] |
ELEMENTS
the periodic table of elements; using the chemical element as
an index for this table yields a printable element name
|
static int |
ELEMMASK
the mask for the chemical element of an atom
|
static int |
ERBIUM |
static int |
EUROPIUM |
static int |
FERMIUM |
static int |
FLOURINE |
static int |
FRANCIUM |
static int |
GADOLINIUM |
static int |
GALLIUM |
static int |
GERMANIUM |
static int |
GOLD |
static int |
HAFNIUM |
static int |
HASSIUM |
static int |
HELIUM |
static int |
HOLMIUM |
static int |
HYDROGEN |
static int |
HYDROMASK
the mask for extracting the hydrogens from an atom type
|
static int |
HYDROSHIFT
the shift value for extracting the hydrogens from an atom type
|
static int |
INDIUM |
static int |
IODINE |
static int |
IRIDIUM |
static int |
IRON |
static int |
KRYPTON |
static int |
LANTHANUM |
static int |
LAWRENCIUM |
static int |
LEAD |
static int |
LITHIUM |
static int |
LUTETIUM |
static int |
MAGNESIUM |
static int |
MANGANESE |
protected static int[][] |
map
the map from element names (character pairs) to element codes
|
static int |
MEITNERIUM |
static int |
MENDELEVIUM |
static int |
MERCURY |
static int |
MOLYBDENUM |
static int |
NEODYMIUM |
static int |
NEON |
static int |
NEPTUNIUM |
static int |
NICKEL |
static int |
NIOBIUM |
static int |
NITROGEN |
static int |
NOBELIUM |
static int |
NULL |
static int |
OSMIUM |
static int |
OXYGEN |
static int |
PALLADIUM |
static int |
PHOSPHORUS |
static int |
PLATINUM |
static int |
PLUTONIUM |
static int |
POLONIUM |
static int |
POTASSIUM |
static int |
PRASEODYMIUM |
static int |
PROMETHIUM |
static int |
PROTACTINIUM |
static int |
RADIUM |
static int |
RADON |
static int |
RHENIUM |
static int |
RHODIUM |
static int |
ROENTGENIUM |
static int |
RUBIDIUM |
static int |
RUTHENIUM |
static int |
RUTHERFORDIUM |
static int |
SAMARIUM |
static int |
SCANDIUM |
static int |
SEABORGIUM |
static int |
SELENIUM |
static int |
SILICON |
static int |
SILVER |
static int |
SODIUM |
static int |
STRONTIUM |
static int |
SULFUR |
static int |
TANTALUM |
static int |
TECHNETIUM |
static int |
TELLURIUM |
static int |
TERBIUM |
static int |
THALLIUM |
static int |
THORIUM |
static int |
THULIUM |
static int |
TIN |
static int |
TITANIUM |
static int |
TUNGSTEN |
static int |
UNKNOWN
atom type: unknown
|
static int |
URANIUM |
static int |
VANADIUM |
static int |
XENON |
static int |
YTTERBIUM |
static int |
YTTRIUM |
static int |
ZINC |
static int |
ZIRCONIUM |
Constructor and Description |
---|
AtomTypeMgr()
Create an atom type manager.
|
Modifier and Type | Method and Description |
---|---|
int |
add(java.lang.String name)
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 java.lang.String |
getChainName()
Get the name of a chain atom.
|
static int |
getCharge(int type)
Extract the charge from an atom type.
|
int |
getCode(java.lang.String name)
Map an atom name to the corresponding code.
|
static int |
getElem(int type)
Extract the chemical element from an atom type.
|
static java.lang.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.
|
java.lang.String |
getName(int code)
Map a code to the corresponding atom name.
|
static java.lang.String |
getWildcard()
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(java.lang.String[] args)
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.
|
getBase, isSpecial, isWildcard
public static final int UNKNOWN
public static final int NULL
public static final int HYDROGEN
public static final int HELIUM
public static final int LITHIUM
public static final int BERYLLIUM
public static final int BORON
public static final int CARBON
public static final int NITROGEN
public static final int OXYGEN
public static final int FLOURINE
public static final int NEON
public static final int SODIUM
public static final int MAGNESIUM
public static final int ALUMINUM
public static final int SILICON
public static final int PHOSPHORUS
public static final int SULFUR
public static final int CHLORINE
public static final int ARGON
public static final int POTASSIUM
public static final int CALCIUM
public static final int SCANDIUM
public static final int TITANIUM
public static final int VANADIUM
public static final int CHROMIUM
public static final int MANGANESE
public static final int IRON
public static final int COBALT
public static final int NICKEL
public static final int COPPER
public static final int ZINC
public static final int GALLIUM
public static final int GERMANIUM
public static final int ARSENIC
public static final int SELENIUM
public static final int BROMINE
public static final int KRYPTON
public static final int RUBIDIUM
public static final int STRONTIUM
public static final int YTTRIUM
public static final int ZIRCONIUM
public static final int NIOBIUM
public static final int MOLYBDENUM
public static final int TECHNETIUM
public static final int RUTHENIUM
public static final int RHODIUM
public static final int PALLADIUM
public static final int SILVER
public static final int CADMIUM
public static final int INDIUM
public static final int TIN
public static final int ANTIMONY
public static final int TELLURIUM
public static final int IODINE
public static final int XENON
public static final int CESIUM
public static final int BARIUM
public static final int LANTHANUM
public static final int CERIUM
public static final int PRASEODYMIUM
public static final int NEODYMIUM
public static final int PROMETHIUM
public static final int SAMARIUM
public static final int EUROPIUM
public static final int GADOLINIUM
public static final int TERBIUM
public static final int DYSPROSIUM
public static final int HOLMIUM
public static final int ERBIUM
public static final int THULIUM
public static final int YTTERBIUM
public static final int LUTETIUM
public static final int HAFNIUM
public static final int TANTALUM
public static final int TUNGSTEN
public static final int RHENIUM
public static final int OSMIUM
public static final int IRIDIUM
public static final int PLATINUM
public static final int GOLD
public static final int MERCURY
public static final int THALLIUM
public static final int LEAD
public static final int BISMUTH
public static final int POLONIUM
public static final int ASTATINE
public static final int RADON
public static final int FRANCIUM
public static final int RADIUM
public static final int ACTINIUM
public static final int THORIUM
public static final int PROTACTINIUM
public static final int URANIUM
public static final int NEPTUNIUM
public static final int PLUTONIUM
public static final int AMERICUM
public static final int CURIUM
public static final int BERKELIUM
public static final int CALIFORNIUM
public static final int EINSTEINIUM
public static final int FERMIUM
public static final int MENDELEVIUM
public static final int NOBELIUM
public static final int LAWRENCIUM
public static final int RUTHERFORDIUM
public static final int DUBNIUM
public static final int SEABORGIUM
public static final int BOHRIUM
public static final int HASSIUM
public static final int MEITNERIUM
public static final int DARMSTADTIUM
public static final int ROENTGENIUM
public static final int COPERNICIUM
public static final int ELEMCNT
public static final int ELEMMASK
public static final int AROMATIC
public static final int CHARGESHIFT
public static final int CHARGEMASK
public static final int HYDROSHIFT
public static final int HYDROMASK
protected static final java.lang.String[] ELEMENTS
protected static int[][] map
public AtomTypeMgr()
public boolean isFixed()
public int add(java.lang.String name)
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.
add
in class TypeMgr
name
- the name of the atomgetCode(String)
public int getCode(java.lang.String name)
public java.lang.String getName(int code)
public static java.lang.String getChainName()
public static java.lang.String getWildcard()
public static int getElem(int 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.
type
- the type from which to extract the chemical elementpublic static java.lang.String getElemName(int type)
type
- the type from which to extract the chemical elementpublic static boolean isChain(int type)
public static boolean isAromatic(int type)
public static int codeCharge(int chg)
The result of this function has to be combined with an element type using a bitwise and.
chg
- the charge to encodepublic static int getCharge(int type)
type
- the type from which to extract the chargepublic static int removeCharge(int type)
type
- the type from which to remove the chargepublic static int codeHydros(int n)
The result of this function has to be combined with an element type using a bitwise and.
n
- the number of hydrogens to encodepublic static int getHydros(int type)
type
- the type from which to extract the hydrogenspublic static int removeHydros(int type)
type
- the type from which to remove the hydrogenspublic static int removeExts(int type)
type
- the type from which to remove the informationpublic static void main(java.lang.String[] args)
It is tried to parse the first command line argument as an atom description and the resulting code is reported.
args
- the command line arguments