X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fdatamodel%2FSequenceFeature.java;h=ca72942e48234b6ade1b7c31f492172c335b0909;hb=ed8d18abc302ac802ad1d0611f3fe2fef570ab5e;hp=3d8744fc47616c6cfa617090604d872a2ffde693;hpb=94e3d91558ad96de545821aeb548934f8c8353a3;p=jalview.git diff --git a/src/jalview/datamodel/SequenceFeature.java b/src/jalview/datamodel/SequenceFeature.java index 3d8744f..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,7 +33,7 @@ public class SequenceFeature public float score; public String type; public String description; - Hashtable otherDetails; + public Hashtable otherDetails; public java.util.Vector links; // Feature group can be set from a features file @@ -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; + } }