001/*
002 *                    PDB web 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 *
015 * Created on Aug 5, 2009
016 * Created by ap3
017 *
018 */
019package org.biojava.nbio.structure.secstruc;
020
021import java.io.Serializable;
022
023/**
024 * Container that represents a hidrogen bond. It contains the energy of the bond
025 * in cal/mol and the partner index.
026 *
027 * @author Andreas Prlic
028 * @author Aleix Lafita
029 *
030 */
031public class HBond implements Serializable {
032
033        private static final long serialVersionUID = 8246764841329431337L;
034
035        private double energy;
036        private int partner;
037
038        public HBond() {
039                energy = 0;
040                partner = 0;
041        }
042
043        public HBond(HBond o) {
044                this.energy = o.energy;
045                this.partner = o.partner;
046        }
047
048        @Override
049        public HBond clone() {
050                return new HBond(this);
051        }
052
053        @Override
054        public String toString() {
055                return partner + " | " + (energy / 1000.0);
056        }
057
058        public double getEnergy() {
059                return energy;
060        }
061
062        public void setEnergy(double energy) {
063                this.energy = energy;
064        }
065
066        public int getPartner() {
067                return partner;
068        }
069
070        public void setPartner(int partner) {
071                this.partner = partner;
072        }
073
074}