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.secstruc; 022 023/** 024 * Container that represents a beta Bridge between two residues. It contains the 025 * two partner indices and the type of the bridge. For consistency, partner1 is 026 * always the small index. 027 * 028 * @author Aleix Lafita 029 * 030 */ 031public class BetaBridge { 032 033 BridgeType type; 034 int partner1; 035 int partner2; 036 037 public BetaBridge(int i, int j, BridgeType t) { 038 partner1 = Math.min(i, j); 039 partner2 = Math.max(i, j); 040 type = t; 041 } 042 043 @Override 044 public boolean equals(Object o) { 045 046 if (!(o instanceof BetaBridge)) 047 return false; 048 049 BetaBridge b = (BetaBridge) o; 050 if (type != b.type) 051 return false; 052 if (partner1 != b.partner1) 053 return false; 054 if (partner2 != b.partner2) 055 return false; 056 return true; 057 } 058 059 public BridgeType getType() { 060 return type; 061 } 062 063 public int getPartner1() { 064 return partner1; 065 } 066 067 public int getPartner2() { 068 return partner2; 069 } 070 071}