ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/owl/branches/aglappe-jung/proteinstructure/RIGNode.java
Revision: 423
Committed: Fri Nov 23 13:37:17 2007 UTC (16 years, 10 months ago) by duarte
File size: 1196 byte(s)
Log Message:
New methods in RIGraph copy() and compare(other)
Basic testing of copy introduced on testJUNGframework
Line File contents
1 package proteinstructure;
2
3 /**
4 * Class representing a Residue Interaction Graph node, i.e. a residue
5 *
6 */
7 public class RIGNode {
8
9 private int residueSerial;
10 private String residueType;
11 private SecStrucElement sselem;
12
13
14 public RIGNode(int residueSerial, String residueType, SecStrucElement sselem) {
15 this.residueSerial = residueSerial;
16 this.residueType = residueType;
17 this.sselem = sselem;
18 }
19
20 public RIGNode(int residueSerial, String residueType) {
21 this.residueSerial = residueSerial;
22 this.residueType = residueType;
23 this.sselem = null;
24 }
25
26 public RIGNode(int residueSerial) {
27 this.residueSerial = residueSerial;
28 this.residueType = null;
29 this.sselem = null;
30 }
31
32 public int getResidueSerial() {
33 return residueSerial;
34 }
35
36 public String getResidueType() {
37 return residueType;
38 }
39
40 public SecStrucElement getSecStrucElement() {
41 return sselem;
42 }
43
44 public String toString() {
45 return "V"+residueSerial;
46 }
47
48 /**
49 * Deep copies this RIGNode
50 * @return
51 */
52 public RIGNode copy() {
53 SecStrucElement newsselem = this.sselem==null?null:this.sselem.copy();
54 RIGNode copy = new RIGNode(this.residueSerial, this.residueType, newsselem);
55 return copy;
56 }
57
58 }