public class ModificationImplementation extends Object implements Modification, Cloneable, Serializable
Modifier and Type | Field and Description |
---|---|
protected int |
iLocation
The location for the modification in the parent sequence.
|
protected ModificationTemplate |
iTemplate
The ModificationTemplate which holds all the shared information for a modification.
|
AVERAGE, CTERMINUS, MONOISOTOPIC, NTERMINUS
Constructor and Description |
---|
ModificationImplementation(ModificationTemplate aTemplate,
int aLocation)
This constructor allows initialization of all the properties for the modification.
|
ModificationImplementation(String aTitle,
String aCode,
HashMap aMassDeltas,
boolean aArtifact,
int aLocation)
This constructor allows initialization of all the properties for the modification.
|
ModificationImplementation(String aTitle,
String aCode,
HashMap aMassDeltas,
int aLocation)
This constructor allows initialization of all the properties for the modification.
|
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.
|
int |
getLocation()
This method returns the location of the modification in the sequence.
|
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.
|
void |
setLocation(int aLocation)
This method allows the setting of the location for this modification.
|
String |
toString()
This method returns a String representation of the Modification.
|
protected ModificationTemplate iTemplate
protected int iLocation
public ModificationImplementation(ModificationTemplate aTemplate, int aLocation)
aTemplate
- ModificationTemplate with the shared information for this modificationaLocation
- int with the location of this modification in the parent sequence.public ModificationImplementation(String aTitle, String aCode, HashMap aMassDeltas, int aLocation)
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) aLocation
- int with the location for this modification.public ModificationImplementation(String aTitle, String aCode, HashMap aMassDeltas, boolean aArtifact, int aLocation)
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 modification is an artifact.aLocation
- int with the location for this modification.public double getAverageMassDelta(String aResidue)
getAverageMassDelta
in interface Modification
aResidue
- String with the residue for which the mass delta needs to be calculated.public String getCode()
getCode
in interface Modification
public String getTitle()
getTitle
in interface Modification
public int getLocation()
getLocation
in interface Modification
public Collection getResidues()
getResidues
in interface Modification
public double getMonoisotopicMassDelta(String aResidue)
getMonoisotopicMassDelta
in interface Modification
aResidue
- String with the residue for which the mass delta needs to be calculated.public void setLocation(int aLocation)
setLocation
in interface Modification
aLocation
- int with the location for this modification within the parent sequence.public boolean isArtifact()
isArtifact
in interface Modification
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()
toString
in interface Modification
toString
in class Object
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'.
compareTo
in interface Comparable
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.