X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fdatamodel%2FSequenceFeature.java;h=ca72942e48234b6ade1b7c31f492172c335b0909;hb=b46b15a5edcd1fa2cd670503287ec753e46245f3;hp=b054ea1958b853212c5bf5a0c533362311cf7fe6;hpb=a2435635b288c8fa08f7f345b9e906c056514ff0;p=jalview.git diff --git a/src/jalview/datamodel/SequenceFeature.java b/src/jalview/datamodel/SequenceFeature.java index b054ea1..ca72942 100755 --- a/src/jalview/datamodel/SequenceFeature.java +++ b/src/jalview/datamodel/SequenceFeature.java @@ -1,6 +1,6 @@ /* * Jalview - A Sequence Alignment Editor and Viewer - * Copyright (C) 2005 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle + * Copyright (C) 2006 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -33,8 +33,7 @@ public class SequenceFeature public float score; public String type; public String description; - public String status; - Hashtable otherDetails; + public Hashtable otherDetails; public java.util.Vector links; // Feature group can be set from a features file @@ -52,11 +51,12 @@ public class SequenceFeature { this.type = type; this.description = desc; - this.status = status; + setValue("status", status); this.begin = begin; this.end = end; this.featureGroup = featureGroup; } + public SequenceFeature(String type, String desc, int begin, int end, @@ -65,7 +65,6 @@ public class SequenceFeature { this.type = type; this.description = desc; - this.status = status; this.begin = begin; this.end = end; this.score = score; @@ -74,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+status).equals - (sf.type+sf.description+sf.status)) + if(!(type+description+featureGroup).equals + (sf.type+sf.description+sf.featureGroup)) return false; return true; @@ -147,21 +146,6 @@ public class SequenceFeature description = desc; } - /** - * DOCUMENT ME! - * - * @return DOCUMENT ME! - */ - public String getStatus() - { - return status; - } - - public void setStatus(String status) - { - this.status = status; - } - public String getFeatureGroup() { return featureGroup; @@ -211,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); + 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); + } + + 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; + } + }