From 951d723ee7a01b954f0af39645e2f1102c1fc99a Mon Sep 17 00:00:00 2001 From: amwaterhouse Date: Fri, 24 Feb 2006 11:38:44 +0000 Subject: [PATCH] Features are now an array, not vector --- src/jalview/datamodel/Sequence.java | 27 +++++++++++++++++++++------ src/jalview/datamodel/SequenceI.java | 4 ++-- 2 files changed, 23 insertions(+), 8 deletions(-) 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! -- 1.7.10.2