1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package net.sf.jniinchi;
20
21 import java.util.ArrayList;
22 import java.util.List;
23
24
25
26
27
28 public class JniInchiStructure {
29
30
31
32
33 private List atomList = new ArrayList();
34
35
36
37
38 private List bondList = new ArrayList();
39
40
41
42
43 private List stereoList = new ArrayList();
44
45
46
47
48
49 public int getNumAtoms() {
50 return atomList.size();
51 }
52
53
54
55
56 public int getNumBonds() {
57 return bondList.size();
58 }
59
60
61
62
63 public int getNumStereo0D() {
64 return stereoList.size();
65 }
66
67
68
69
70
71
72
73
74 @SuppressWarnings("unchecked")
75 public JniInchiAtom addAtom(JniInchiAtom atom) {
76 atomList.add(atom);
77 return atom;
78 }
79
80
81
82
83
84
85 public void addAtoms(JniInchiAtom... atoms) {
86 for (JniInchiAtom atom : atoms) {
87 addAtom(atom);
88 }
89 }
90
91
92
93
94
95
96
97 @SuppressWarnings("unchecked")
98 public JniInchiBond addBond(JniInchiBond bond) {
99 bondList.add(bond);
100 return bond;
101 }
102
103
104
105
106
107 public void addBonds(JniInchiBond... bonds) {
108 for (JniInchiBond bond : bonds) {
109 addBond(bond);
110 }
111 }
112
113
114
115
116
117
118
119 @SuppressWarnings("unchecked")
120 public JniInchiStereo0D addStereo0D(JniInchiStereo0D parity) {
121 stereoList.add(parity);
122 return parity;
123 }
124
125
126
127
128
129
130
131 public JniInchiAtom getAtom(final int i) {
132 return (JniInchiAtom) atomList.get(i);
133 }
134
135
136
137
138
139
140 public JniInchiBond getBond(final int i) {
141 return (JniInchiBond) bondList.get(i);
142 }
143
144
145
146
147
148
149 public JniInchiStereo0D getStereo0D(final int i) {
150 return (JniInchiStereo0D) stereoList.get(i);
151 }
152
153 public void setStructure(JniInchiStructure structure) {
154 this.atomList = structure.atomList;
155 this.bondList = structure.bondList;
156 this.stereoList = structure.stereoList;
157 }
158
159 int getAtomIndex(JniInchiAtom atom) {
160 return atomList.indexOf(atom);
161 }
162
163 int getStereo0DIndex(JniInchiStereo0D stereo) {
164 return stereoList.indexOf(stereo);
165 }
166 }