From: amwaterhouse Date: Fri, 24 Feb 2006 11:38:44 +0000 (+0000) Subject: Features are now an array, not vector X-Git-Tag: Root_VamJalview_2_07b+~105 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=951d723ee7a01b954f0af39645e2f1102c1fc99a;p=jalview.git Features are now an array, not vector --- diff --git a/src/jalview/datamodel/Sequence.java b/src/jalview/datamodel/Sequence.java index d35a05b..48057b8 100755 --- a/src/jalview/datamodel/Sequence.java +++ b/src/jalview/datamodel/Sequence.java @@ -47,7 +47,7 @@ public class Sequence implements SequenceI Vector annotation; /** DOCUMENT ME!! */ - public Vector sequenceFeatures; + public SequenceFeature [] sequenceFeatures; /** * Creates a new Sequence object. @@ -136,25 +136,40 @@ public class Sequence implements SequenceI * * @param v DOCUMENT ME! */ - public void setSequenceFeatures(Vector v) + public void setSequenceFeatures(SequenceFeature [] features) { - sequenceFeatures = v; + sequenceFeatures = features; } public void addSequenceFeature(SequenceFeature sf) { if(sequenceFeatures==null) - sequenceFeatures = new Vector(); + { + sequenceFeatures = new SequenceFeature[0]; + } + + SequenceFeature [] temp = new SequenceFeature[sequenceFeatures.length+1]; + System.arraycopy(sequenceFeatures, 0, temp, 0, sequenceFeatures.length); + temp[sequenceFeatures.length] = sf; - sequenceFeatures.addElement(sf); + + sequenceFeatures = temp; } + SequenceFeature [] sfarray; + + public SequenceFeature[] getsfarray() + { + return sfarray; + } + + /** * DOCUMENT ME! * * @return DOCUMENT ME! */ - public Vector getSequenceFeatures() + public SequenceFeature [] getSequenceFeatures() { return sequenceFeatures; } diff --git a/src/jalview/datamodel/SequenceI.java b/src/jalview/datamodel/SequenceI.java index 21f7cc4..089a5f6 100755 --- a/src/jalview/datamodel/SequenceI.java +++ b/src/jalview/datamodel/SequenceI.java @@ -211,14 +211,14 @@ public interface SequenceI * * @return DOCUMENT ME! */ - public Vector getSequenceFeatures(); + public SequenceFeature[] getSequenceFeatures(); /** * DOCUMENT ME! * * @param v DOCUMENT ME! */ - public void setSequenceFeatures(Vector v); + public void setSequenceFeatures(SequenceFeature [] features); /** * DOCUMENT ME!