Class AtomContactSet
- java.lang.Object
-
- org.biojava.nbio.structure.contact.AtomContactSet
-
- All Implemented Interfaces:
Serializable
,Iterable<AtomContact>
public class AtomContactSet extends Object implements Serializable, Iterable<AtomContact>
A set of atom-atom contacts to hold the results of intra and inter-chain contact calculations- Author:
- duarte_j
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description AtomContactSet(double cutoff)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(AtomContact contact)
void
addAll(Collection<AtomContact> list)
AtomContact
getContact(Atom atom1, Atom atom2)
Returns the corresponding AtomContact or null if no contact exists between the 2 given atomsList<AtomContact>
getContactsWithinDistance(double distance)
Returns the list of contacts from this set that are within the given distance.boolean
hasContact(Atom atom1, Atom atom2)
boolean
hasContact(AtomIdentifier atomId1, AtomIdentifier atomId2)
boolean
hasContactsWithinDistance(double distance)
Returns true if at least 1 contact from this set is within the given distance.Iterator<AtomContact>
iterator()
int
size()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Constructor Detail
-
AtomContactSet
public AtomContactSet(double cutoff)
-
-
Method Detail
-
add
public void add(AtomContact contact)
-
addAll
public void addAll(Collection<AtomContact> list)
-
hasContact
public boolean hasContact(Atom atom1, Atom atom2)
-
hasContact
public boolean hasContact(AtomIdentifier atomId1, AtomIdentifier atomId2)
-
getContact
public AtomContact getContact(Atom atom1, Atom atom2)
Returns the corresponding AtomContact or null if no contact exists between the 2 given atoms- Parameters:
atom1
-atom2
-- Returns:
-
size
public int size()
-
iterator
public Iterator<AtomContact> iterator()
- Specified by:
iterator
in interfaceIterable<AtomContact>
-
hasContactsWithinDistance
public boolean hasContactsWithinDistance(double distance)
Returns true if at least 1 contact from this set is within the given distance. Note that if the distance given is larger than the distance cutoff used to calculate the contacts then nothing will be found.- Parameters:
distance
-- Returns:
- Throws:
IllegalArgumentException
- if given distance is larger than distance cutoff used for calculation of contacts
-
getContactsWithinDistance
public List<AtomContact> getContactsWithinDistance(double distance)
Returns the list of contacts from this set that are within the given distance.- Parameters:
distance
-- Returns:
- Throws:
IllegalArgumentException
- if given distance is larger than distance cutoff used for calculation of contacts
-
-