001/*
002 *                    BioJava development code
003 *
004 * This code may be freely distributed and modified under the
005 * terms of the GNU Lesser General Public Licence.  This should
006 * be distributed with the code.  If you do not have a copy,
007 * see:
008 *
009 *      http://www.gnu.org/copyleft/lesser.html
010 *
011 * Copyright for this code is held jointly by the individual
012 * authors.  These should be listed in @author doc comments.
013 *
014 * For more information on the BioJava project and its aims,
015 * or to join the biojava-l mailing list, visit the home page
016 * at:
017 *
018 *      http://www.biojava.org/
019 *
020 */
021package org.biojava.nbio.structure.io.util;
022
023/**
024 * <b>Internal use only. Do not use this class.</b>
025 *
026 * A class for temporary storing of data when parsing PDB Files.
027 *
028 * Why is this here? Because making private inner classes in PDBFileParser would
029 * make that hulking giant of a class even more gigantic.
030 *
031 * @author Ulysse Carion
032 */
033public class PDBTemporaryStorageUtils {
034        /**
035         * Temporary data storage for LINK records. This is necessary because LINK
036         * records precede the atoms they correspond to in a PDB file, so we must
037         * store the information encoded in a LINK record until we actually know
038         * about the atoms a LINK refers to.
039         *
040         * @author Ulysse Carion
041         */
042        public static class LinkRecord {
043                private String name1;
044                private String altLoc1;
045                private String resName1;
046                private String chainID1;
047                private String resSeq1;
048                private String iCode1;
049
050                private String name2;
051                private String altLoc2;
052                private String resName2;
053                private String chainID2;
054                private String resSeq2;
055                private String iCode2;
056
057                private String sym1;
058                private String sym2;
059
060                public LinkRecord(String name1, String altLoc1, String resName1,
061                                String chainID1, String resSeq1, String iCode1, String name2,
062                                String altLoc2, String resName2, String chainID2,
063                                String resSeq2, String iCode2, String sym1, String sym2) {
064                        this.name1 = name1;
065                        this.altLoc1 = altLoc1;
066                        this.resName1 = resName1;
067                        this.chainID1 = chainID1;
068                        this.resSeq1 = resSeq1;
069                        this.iCode1 = iCode1;
070                        this.name2 = name2;
071                        this.altLoc2 = altLoc2;
072                        this.resName2 = resName2;
073                        this.chainID2 = chainID2;
074                        this.resSeq2 = resSeq2;
075                        this.iCode2 = iCode2;
076                        this.sym1 = sym1;
077                        this.sym2 = sym2;
078                }
079
080                public String getName1() {
081                        return name1;
082                }
083
084                public String getAltLoc1() {
085                        return altLoc1;
086                }
087
088                public String getResName1() {
089                        return resName1;
090                }
091
092                public String getChainID1() {
093                        return chainID1;
094                }
095
096                public String getResSeq1() {
097                        return resSeq1;
098                }
099
100                public String getiCode1() {
101                        return iCode1;
102                }
103
104                public String getName2() {
105                        return name2;
106                }
107
108                public String getAltLoc2() {
109                        return altLoc2;
110                }
111
112                public String getResName2() {
113                        return resName2;
114                }
115
116                public String getChainID2() {
117                        return chainID2;
118                }
119
120                public String getResSeq2() {
121                        return resSeq2;
122                }
123
124                public String getiCode2() {
125                        return iCode2;
126                }
127
128                public String getSym1() {
129                        return sym1;
130                }
131
132                public String getSym2() {
133                        return sym2;
134                }
135
136                @Override
137                public String toString() {
138                        String s = "[LINK Record:\n";
139
140                        s += "Atom 1:\n";
141                        s += "\tName: " + name1 + "\n";
142                        s += "\tAlt Loc: " + altLoc1 + "\n";
143                        s += "\tRes name: " + resName1 + "\n";
144                        s += "\tChain ID: " + chainID1 + "\n";
145                        s += "\tRes Seq: " + resSeq1 + "\n";
146                        s += "\tIns Code: " + iCode1 + "\n";
147
148                        s += "Atom 2:\n";
149                        s += "\tName: " + name2 + "\n";
150                        s += "\tAlt Loc: " + altLoc2 + "\n";
151                        s += "\tRes name: " + resName2 + "\n";
152                        s += "\tChain ID: " + chainID2 + "\n";
153                        s += "\tRes Seq: " + resSeq2 + "\n";
154                        s += "\tIns Code: " + iCode2 + "\n";
155
156                        s += "]";
157
158                        return s;
159                }
160        }
161}