compomics / compomics-utilities

Open source Java library for computational proteomics
http://compomics.github.io/projects/compomics-utilities.html
30 stars 17 forks source link

Usage of List instead of Vector on parameters #4

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi,

Could the following method be updated to use List<SpectrumAnnotation> instead 
of Vector:

com.compomics.util.gui.spectrum.GraphicsPanel.setAnnotations();

It currently uses Vector which is preventing me from using 
LinkedList/ArrayList. As Vector implements List and doesn't appear to use of 
the Vector specific methods this should hopefully be a minor yet helpful (to 
me) change. :)

Thank you! :)

Original issue reported on code.google.com by detritus.c on 20 May 2014 at 3:20

GoogleCodeExporter commented 9 years ago
Should not be a problem. I've now added a new method 
setAnnotationsAsList(List<SpectrumAnnotation> aAnnotations) which should cover 
your needs?

It will be included in the next release. I'll let you know as soon as it's 
deployed.

Original comment by harald.b...@gmail.com on 20 May 2014 at 4:39

GoogleCodeExporter commented 9 years ago
Thanks for this, saves an unnecessary call to new Vector()
Though you don't necessarily need the "AsList" part. Both methods should be 
able to exist with the same name.
Though further to this I'm not entirely sure the original version accepting a 
Vector needs to be kept.
As Vector implements List, a simple change to List *hopefully* should be 
backwards compatible. :)

Original comment by detritus.c on 20 May 2014 at 5:18

GoogleCodeExporter commented 9 years ago
Ah, yes, I you are correct. I had some other compatibility issues. Fixed now. 

In the new version it'll just be setAnnotations(List<SpectrumAnnotation> 
aAnnotations).

The new version (v3.26.40) has been deployed.

Original comment by harald.b...@gmail.com on 20 May 2014 at 7:59

GoogleCodeExporter commented 9 years ago
Thank you. Now able to build vector-free against v.3.27.0 :)

Original comment by detritus.c on 22 May 2014 at 10:49