1 |
package proteinstructure; |
2 |
|
3 |
public class AIGNode { |
4 |
|
5 |
private int atomSerial; |
6 |
private String atomName; |
7 |
private RIGNode parentResidue; |
8 |
|
9 |
public AIGNode(int atomSerial, String atomName, RIGNode parentResidue) { |
10 |
this.atomSerial = atomSerial; |
11 |
this.atomName = atomName; |
12 |
this.parentResidue = parentResidue; |
13 |
} |
14 |
|
15 |
public int getAtomSerial() { |
16 |
return this.atomSerial; |
17 |
} |
18 |
|
19 |
public String getAtomName() { |
20 |
return this.atomName; |
21 |
} |
22 |
|
23 |
public RIGNode getParent() { |
24 |
return this.parentResidue; |
25 |
} |
26 |
|
27 |
/** |
28 |
* Convenience method to get the residue serial for this atom node |
29 |
* @return |
30 |
*/ |
31 |
public int getResidueSerial() { |
32 |
return this.parentResidue.getResidueSerial(); |
33 |
} |
34 |
|
35 |
public boolean equals(Object obj) { |
36 |
if (obj instanceof AIGNode) { |
37 |
AIGNode v = (AIGNode) obj; |
38 |
return ((this.parentResidue.equals(v.getParent())) && (this.atomSerial == v.getAtomSerial()) && (this.atomName.equals(v.getAtomName()))); |
39 |
} else { |
40 |
return false; |
41 |
} |
42 |
} |
43 |
|
44 |
public AIGNode copy() { |
45 |
return (new AIGNode(atomSerial, atomName, this.parentResidue.copy())); |
46 |
} |
47 |
} |