org.biojava3.protmod.structure
Class ModifiedCompoundImpl

java.lang.Object
  extended by org.biojava3.protmod.structure.ModifiedCompoundImpl
All Implemented Interfaces:
Serializable, Comparable<ModifiedCompound>, ModifiedCompound

public class ModifiedCompoundImpl
extends Object
implements ModifiedCompound, Serializable, Comparable<ModifiedCompound>

Since:
3.0
Author:
Jianjiong Gao
See Also:
Serialized Form

Field Summary
static String newline
           
 
Constructor Summary
ModifiedCompoundImpl()
           
ModifiedCompoundImpl(ProteinModification modification, Collection<StructureAtomLinkage> linkages)
           
ModifiedCompoundImpl(ProteinModification modification, StructureGroup modifiedResidue)
          Create a ModifiedCompoundImpl that has only one involved component.
 
Method Summary
 boolean addAtomLinkage(StructureAtomLinkage linkage)
          Add a linkage.
 void addAtomLinkages(Collection<StructureAtomLinkage> linkages)
          Add a collections of linkages.
 int compareTo(ModifiedCompound compound)
           
 boolean crossChains()
           
 boolean equals(Object obj)
           
 Set<StructureAtomLinkage> getAtomLinkages()
           
 String getDescription()
          return a description of this compound
 Set<StructureGroup> getGroups()
           
 Set<StructureGroup> getGroups(boolean isAminoAcid)
           
 ProteinModification getModification()
           
 String getOriginalModificationId()
          Deprecated. use getModification().getId()
 int hashCode()
           
 void setAtomLinkages(Set<StructureAtomLinkage> linkages)
          Set atom linkages
 void setDescription(String desc)
           
 void setGroups(Set<StructureGroup> groups)
           
 void setModification(ProteinModification protmod)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

newline

public static final String newline
Constructor Detail

ModifiedCompoundImpl

public ModifiedCompoundImpl()

ModifiedCompoundImpl

public ModifiedCompoundImpl(ProteinModification modification,
                            StructureGroup modifiedResidue)
Create a ModifiedCompoundImpl that has only one involved component. Use this constructor for a modified residue.

Parameters:
modification - ProteinModification.
modifiedResidue - modified group.
Throws:
IllegalArgumentException - if either argument is null.

ModifiedCompoundImpl

public ModifiedCompoundImpl(ProteinModification modification,
                            Collection<StructureAtomLinkage> linkages)
Parameters:
modification - ProteinModification.
linkages - a collection of atom linkages.
See Also:
ProteinModification, StructureAtomLinkage
Method Detail

setModification

public void setModification(ProteinModification protmod)
Specified by:
setModification in interface ModifiedCompound

getModification

public ProteinModification getModification()
Specified by:
getModification in interface ModifiedCompound
Returns:
ProteinModificationBean occurred on the residue.

getOriginalModificationId

public String getOriginalModificationId()
Deprecated. use getModification().getId()

Returns:
the original modification ID.

getGroups

public Set<StructureGroup> getGroups()
Specified by:
getGroups in interface ModifiedCompound
Returns:
a set of involved group.

getGroups

public Set<StructureGroup> getGroups(boolean isAminoAcid)
Specified by:
getGroups in interface ModifiedCompound
Parameters:
isAminoAcid - true if amino acids.
Returns:
a set of involved group of the type.

setGroups

public void setGroups(Set<StructureGroup> groups)
Specified by:
setGroups in interface ModifiedCompound

getAtomLinkages

public Set<StructureAtomLinkage> getAtomLinkages()
Specified by:
getAtomLinkages in interface ModifiedCompound
Returns:
a set of atom linkages.
See Also:
#getLinkedGroupPairs, StructureAtomLinkage

setAtomLinkages

public void setAtomLinkages(Set<StructureAtomLinkage> linkages)
Description copied from interface: ModifiedCompound
Set atom linkages

Specified by:
setAtomLinkages in interface ModifiedCompound

addAtomLinkage

public boolean addAtomLinkage(StructureAtomLinkage linkage)
Description copied from interface: ModifiedCompound
Add a linkage. Add new the involved groups first using addGroup.

Specified by:
addAtomLinkage in interface ModifiedCompound
Parameters:
linkage - an atom linkage.
Returns:
true if this linkage was not already contained.
See Also:
StructureAtomLinkage

addAtomLinkages

public void addAtomLinkages(Collection<StructureAtomLinkage> linkages)
Description copied from interface: ModifiedCompound
Add a collections of linkages.

Specified by:
addAtomLinkages in interface ModifiedCompound
Parameters:
linkages - an atom linkage.

crossChains

public boolean crossChains()
Specified by:
crossChains in interface ModifiedCompound
Returns:
true if groups from multiple chains were involved

toString

public String toString()
Overrides:
toString in class Object

getDescription

public String getDescription()
Description copied from interface: ModifiedCompound
return a description of this compound

Specified by:
getDescription in interface ModifiedCompound
Returns:
a description

setDescription

public void setDescription(String desc)
Specified by:
setDescription in interface ModifiedCompound

compareTo

public int compareTo(ModifiedCompound compound)
Specified by:
compareTo in interface Comparable<ModifiedCompound>

equals

public boolean equals(Object obj)
Overrides:
equals in class Object
Returns:
true if same modification and same components; false, otherwise.

hashCode

public int hashCode()
Overrides:
hashCode in class Object