From: amwaterhouse Date: Thu, 15 Jun 2006 12:51:52 +0000 (+0000) Subject: Maintain status and position only for uniprot parsing X-Git-Tag: Release_2_1~350 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=62f21e48108443babb5c855967c6d388f23904d4;p=jalview.git Maintain status and position only for uniprot parsing --- diff --git a/src/jalview/datamodel/Sequence.java b/src/jalview/datamodel/Sequence.java index 09c9a69..0dec805 100755 --- a/src/jalview/datamodel/Sequence.java +++ b/src/jalview/datamodel/Sequence.java @@ -146,7 +146,7 @@ public class Sequence implements SequenceI sequenceFeatures = features; } - public void addSequenceFeature(SequenceFeature sf) + public synchronized void addSequenceFeature(SequenceFeature sf) { if(sequenceFeatures==null) { @@ -165,7 +165,6 @@ public class Sequence implements SequenceI System.arraycopy(sequenceFeatures, 0, temp, 0, sequenceFeatures.length); temp[sequenceFeatures.length] = sf; - sequenceFeatures = temp; } diff --git a/src/jalview/datamodel/SequenceFeature.java b/src/jalview/datamodel/SequenceFeature.java index 3d8744f..ef391eb 100755 --- a/src/jalview/datamodel/SequenceFeature.java +++ b/src/jalview/datamodel/SequenceFeature.java @@ -51,9 +51,7 @@ public class SequenceFeature { this.type = type; this.description = desc; - if(status!=null) - setValue("status", status); - + setValue("status", status); this.begin = begin; this.end = end; this.featureGroup = featureGroup; @@ -75,13 +73,13 @@ public class SequenceFeature public boolean equals(SequenceFeature sf) { - if(begin != sf.begin - || end != sf.end) - return false; - + if (begin != sf.begin + || end != sf.end + || score != sf.score) + return false; - if(!(type+description).equals - (sf.type+sf.description)) + if(!(type+description+featureGroup).equals + (sf.type+sf.description+sf.featureGroup)) return false; return true; @@ -197,11 +195,42 @@ public class SequenceFeature */ public void setValue(String key, Object value) { - if(otherDetails == null) - otherDetails = new Hashtable(); + if(value!=null) + { + if (otherDetails == null) + otherDetails = new Hashtable(); + + otherDetails.put(key, value); + } + } + + + /* + * The following methods are added to maintain + * the castor Uniprot mapping file for the moment. + */ + public void setStatus(String status) + { + setValue("status", status); + } - otherDetails.put(key, value); + public String getStatus() + { + if (otherDetails != null) + return otherDetails.get("status").toString(); + else + return null; } + public void setPosition(int pos) + { + begin = pos; + end = pos; + } + + public int getPosition() + { + return begin; + } }