Package org.biojava.nbio.structure
Class ResidueNumber
- java.lang.Object
-
- org.biojava.nbio.structure.ResidueNumber
-
- All Implemented Interfaces:
Serializable
,Comparable<ResidueNumber>
public class ResidueNumber extends Object implements Serializable, Comparable<ResidueNumber>
Everything that is needed to uniquely describe a residue position- Author:
- Andreas Prlic
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ResidueNumber()
ResidueNumber(String chainName, Integer residueNumber, Character insCode)
ResidueNumber(ResidueNumber o)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(ResidueNumber other)
Compare residue numbers by chain, sequence number, and insertion codeint
compareToPositional(ResidueNumber other)
Compare residue numbers by sequence number and insertion code, ignoring the chainboolean
equals(Object obj)
boolean
equalsPositional(Object obj)
Check if the seqNum and insertion code are equivalent, ignoring the chainstatic ResidueNumber
fromString(String pdb_code)
Convert a string representation of a residue number to a residue number object.String
getChainName()
Character
getInsCode()
Integer
getSeqNum()
int
hashCode()
String
printFull()
void
setChainName(String chainName)
void
setInsCode(Character insCode)
void
setSeqNum(Integer seqNum)
String
toPDB()
String
toString()
-
-
-
Constructor Detail
-
ResidueNumber
public ResidueNumber()
-
ResidueNumber
public ResidueNumber(ResidueNumber o)
-
ResidueNumber
public ResidueNumber(String chainName, Integer residueNumber, Character insCode)
-
-
Method Detail
-
getChainName
public String getChainName()
-
setChainName
public void setChainName(String chainName)
-
getInsCode
public Character getInsCode()
-
setInsCode
public void setInsCode(Character insCode)
-
equalsPositional
public boolean equalsPositional(Object obj)
Check if the seqNum and insertion code are equivalent, ignoring the chain- Parameters:
obj
-- Returns:
-
toString
public String toString()
- Overrides:
toString
in classObject
- Returns:
- The residue number and insertion code as a string, eg "74A"
- See Also:
Object.toString()
-
toPDB
public String toPDB()
- Returns:
- The chain, number, and insertion code as a string, eg "B 74A" or "A 1 "
-
fromString
public static ResidueNumber fromString(String pdb_code)
Convert a string representation of a residue number to a residue number object. The string representation can be a integer followed by a character.- Parameters:
pdb_code
-- Returns:
- a ResidueNumber object, or null if the input was null
-
compareTo
public int compareTo(ResidueNumber other)
Compare residue numbers by chain, sequence number, and insertion code- Specified by:
compareTo
in interfaceComparable<ResidueNumber>
-
compareToPositional
public int compareToPositional(ResidueNumber other)
Compare residue numbers by sequence number and insertion code, ignoring the chain- Parameters:
other
-- Returns:
-
-