public class AnnotatedPeak<A extends PeakAnnotation> extends Peak
| Constructor and Description |
|---|
AnnotatedPeak()
Default constructor.
|
AnnotatedPeak(AnnotatedPeak<A> src)
Copy constructor.
|
AnnotatedPeak(double mz,
double intensity,
int charge,
A... annotations)
Constructs a AnnotatedPeak.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(A annotation)
Add
annotation to this AnnotatedPeak |
AnnotatedPeak<A> |
copy()
Creates and returns a copy of this object.
|
boolean |
equals(Object o) |
A |
getAnnotation(int index)
Returns the annotation at the specified position in this peak.
|
int |
getAnnotationCount()
Returns the number of annotations in this peak.
|
List<A> |
getAnnotations()
Returns an unmodifiable list containing this peaks annotations
|
boolean |
hasAnnotations()
Returns true this peak has annotations, false otherwise.
|
int |
hashCode() |
boolean |
remove(A annotation)
Remove
annotation from this AnnotatedPeak |
A |
remove(int index)
Removes the annotation at the specified position in this peak.
|
void |
sortAnnotations(Comparator<A> comparator)
Use the
comparator to sort this peaks annotations |
String |
toString() |
compareTo, getCharge, getChargeList, getIntensity, getMass, getMz, getPolarity, noIntensity, setIntensity, setMzAndCharge, setValuespublic AnnotatedPeak()
mz = 0.0
intensity = 0.0
charge = 0
annotations = empty list
public AnnotatedPeak(double mz,
double intensity,
int charge,
A... annotations)
mz - the peak m/zintensity - the peakcharge - the peak chargeannotations - the annotationspublic AnnotatedPeak(AnnotatedPeak<A> src)
src - the AnnotatedPeak to copypublic boolean add(A annotation)
annotation to this AnnotatedPeakannotation - the annotation to addpublic boolean remove(A annotation)
annotation from this AnnotatedPeakannotation - the annotation to removepublic A remove(int index)
index - the index of the annotation to be removedIndexOutOfBoundsException - if the index is out of range
(index < 0 || index >= getAnnotationCount())public A getAnnotation(int index)
index - index of the annotation to returnIndexOutOfBoundsException - if the index is out of range
(index < 0 || index >= getAnnotationCount())public int getAnnotationCount()
public boolean hasAnnotations()
public List<A> getAnnotations()
public void sortAnnotations(Comparator<A> comparator)
comparator to sort this peaks annotationscomparator - the comparator that is used to sort the annotationspublic AnnotatedPeak<A> copy()
Copyablex, the expression:
will be true, and that the expression:x.copy() != x
will bex.copy().getClass() == x.getClass()
true, but these are not absolute requirements.
While it is typically the case that:
will bex.copy().equals(x)
true, this is not an absolute requirement.
Copyright © 2016. All Rights Reserved.