Debian Codegraph @

jna-inchi-api/src/main/java/io/github/dan2097/jnainchi/InchiBondStereo.java

raw
1 /**
2 * JNA-InChI - Library for calling InChI from Java
3 * Copyright © 2018 Daniel Lowe
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18 package io.github.dan2097.jnainchi;
19
20 import java.util.HashMap;
21 import java.util.Map;
22
23 import io.github.dan2097.jnainchi.inchi.InchiLibrary.tagINCHIBondStereo2D;
24
25 public enum InchiBondStereo {
26
27 /** No stereo information recorded for this bond */
28 NONE(tagINCHIBondStereo2D.INCHI_BOND_STEREO_NONE),
29
30 /**sharp end points to this atom i.e. reference atom is {@link InchiBond#getStart()} */
31 SINGLE_1UP(tagINCHIBondStereo2D.INCHI_BOND_STEREO_SINGLE_1UP),
32
33 /**sharp end points to this atom i.e. reference atom is {@link InchiBond#getStart()} */
34 SINGLE_1EITHER(tagINCHIBondStereo2D.INCHI_BOND_STEREO_SINGLE_1EITHER),
35
36 /**sharp end points to this atom i.e. reference atom is {@link InchiBond#getStart()} */
37 SINGLE_1DOWN(tagINCHIBondStereo2D.INCHI_BOND_STEREO_SINGLE_1DOWN),
38
39 /**sharp end points to the opposite atom i.e. reference atom is {@link InchiBond#getEnd()} */
40 SINGLE_2UP(tagINCHIBondStereo2D.INCHI_BOND_STEREO_SINGLE_2UP),
41
42 /**sharp end points to the opposite atom i.e. reference atom is {@link InchiBond#getEnd()} */
43 SINGLE_2EITHER(tagINCHIBondStereo2D.INCHI_BOND_STEREO_SINGLE_2EITHER),
44
45 /**sharp end points to the opposite atom i.e. reference atom is {@link InchiBond#getEnd()} */
46 SINGLE_2DOWN(tagINCHIBondStereo2D.INCHI_BOND_STEREO_SINGLE_2DOWN),
47
48 /** unknown stereobond geometry*/
49 DOUBLE_EITHER(tagINCHIBondStereo2D.INCHI_BOND_STEREO_DOUBLE_EITHER);
50
51 private final byte code;
52
53 private InchiBondStereo(int code) {
54 this.code = (byte) code;
55 }
56
57 byte getCode() {
58 return code;
59 }
60
61 private static final Map<Byte, InchiBondStereo> map = new HashMap<>();
62
63 static {
64 for (InchiBondStereo val : InchiBondStereo.values()) {
65 map.put(val.code, val);
66 }
67 }
68
69 static InchiBondStereo of(byte code) {
70 return map.get(code);
71 }
72
73 }