public class ModificationTemplate extends Object
Modifier and Type | Field and Description |
---|---|
protected boolean |
iArtifact
Boolean to indicate whether this modification is an artifact.
|
protected String |
iCode
The code for this modification (eg., Mox).
|
protected HashMap |
iMassDeltas
This HashMap will contain the following 'key-value' mappings: (key > value)
(residue > double[]{MONOISOTOPIC_DELTA, AVERAGE_DELTA}) |
protected String |
iTitle
The title for this modification (eg., Oxidation Met).
|
Constructor and Description |
---|
ModificationTemplate(String aTitle,
String aCode,
HashMap aMassDeltas)
This constructor allows initialization of all the properties for the modification template.
|
ModificationTemplate(String aTitle,
String aCode,
HashMap aMassDeltas,
boolean aArtifact)
This constructor allows initialization of all the properties for the modification template.
|
Modifier and Type | Method and Description |
---|---|
Object |
clone()
Override of the clone method.
|
int |
compareTo(Object o)
Compares this object with the specified object for order.
|
boolean |
equals(Object obj)
Indicates whether some other object is "equal to" this one.
|
double |
getAverageMassDelta(String aResidue)
This method returns a double with the average mass difference
conferred on the sequence by this modification for the specified residue.
|
String |
getCode()
This method returns the short code for the modification, eg.
|
protected double |
getMassDelta(String aResidue,
int aMonoOrAvg)
This method returns the mass delta for the specified residue, measured either
monoisotopically or averaged.
|
double |
getMonoisotopicMassDelta(String aResidue)
This method returns a double with the monoisotopic mass difference
conferred on the sequence by this modification for the specified residue.
|
Collection |
getResidues()
This method reports on all the residues that can be modified by this Modification.
|
String |
getTitle()
This method returns the title of the modification,
eg.
|
int |
hashCode()
Returns a hash code value for the object.
|
boolean |
isArtifact()
This method indicates whether this modification is considered an artifact.
|
String |
toString()
This method returns a String representation of the Modification.
|
protected HashMap iMassDeltas
protected String iCode
protected String iTitle
protected boolean iArtifact
public ModificationTemplate(String aTitle, String aCode, HashMap aMassDeltas)
aTitle
- String with the title for the modification (eg., Oxidation Met).aCode
- String with the code for the modification (eg., Mox). The code can be used when
annotating a sequence String (eg., NH2-MGTEFSM<Mox>R-COOH).aMassDeltas
- HashMap with the following 'key-value' mappings: (key > value) public ModificationTemplate(String aTitle, String aCode, HashMap aMassDeltas, boolean aArtifact)
aTitle
- String with the title for the modification (eg., Oxidation Met).aCode
- String with the code for the modification (eg., Mox). The code can be used when
annotating a sequence String (eg., NH2-MGTEFSM<Mox>R-COOH).aMassDeltas
- HashMap with the following 'key-value' mappings: (key > value) aArtifact
- boolean to indicate whether this class is an artifact.public double getAverageMassDelta(String aResidue)
aResidue
- String with the residue for which the mass delta needs to be calculated.public String getCode()
public String getTitle()
public Collection getResidues()
public double getMonoisotopicMassDelta(String aResidue)
aResidue
- String with the residue for which the mass delta needs to be calculated.public boolean isArtifact()
public boolean equals(Object obj)
equals
in class Object
obj
- the reference object with which to compare.true
if this object is the same as the obj
argument; false
otherwise.hashCode()
,
Hashtable
public int hashCode()
java.util.Hashtable
.
The general contract of hashCode
is:
hashCode
method on each of
the two objects must produce the same integer result.
Object.equals(Object)
method, then calling the hashCode method on each of the
two objects must produce distinct integer results. However, the
programmer should be aware that producing distinct integer results
for unequal objects may improve the performance of hashtables.
As much as is reasonably practical, the hashCode method defined by class Object does return distinct integers for distinct objects. (This is typically implemented by converting the internal address of the object into an integer, but this implementation technique is not required by the Java programming language.)
hashCode
in class Object
Object.equals(Object)
,
Hashtable
public String toString()
public Object clone()
public int compareTo(Object o)
In this implementation, ordering is first done on location, and only if this is identical, the title is compared. Therefore, since equals uses title and location as well, two equals instances will compare to '0'.
o
- the Object to be compared.ClassCastException
- if the specified object's type prevents it
from being compared to this Object.protected double getMassDelta(String aResidue, int aMonoOrAvg)
aResidue
- String with the residue for which the modification applies (value for the N-terminus is
the NTERMINUS constant and for the C-terminus the CTERMINUS constant).aMonoOrAvg
- int which should be either MONOISOTOPIC or AVERAGECopyright © 2016. All rights reserved.