git://source.jalview.org
/
jalview.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
49428d3
)
JAL-653 encapsulate Strand, Attributes, Status of SequenceFeature
author
gmungoc
<g.m.carstairs@dundee.ac.uk>
Tue, 22 Dec 2015 09:21:58 +0000
(09:21 +0000)
committer
gmungoc
<g.m.carstairs@dundee.ac.uk>
Tue, 22 Dec 2015 09:21:58 +0000
(09:21 +0000)
src/jalview/datamodel/SequenceFeature.java
patch
|
blob
|
history
diff --git
a/src/jalview/datamodel/SequenceFeature.java
b/src/jalview/datamodel/SequenceFeature.java
index
e60e0c8
..
6f514f7
100755
(executable)
--- a/
src/jalview/datamodel/SequenceFeature.java
+++ b/
src/jalview/datamodel/SequenceFeature.java
@@
-32,6
+32,12
@@
import java.util.Vector;
*/
public class SequenceFeature
{
*/
public class SequenceFeature
{
+ private static final String STATUS = "status";
+
+ private static final String STRAND = "STRAND";
+
+ private static final String ATTRIBUTES = "ATTRIBUTES";
+
public int begin;
public int end;
public int begin;
public int end;
@@
-107,7
+113,7
@@
public class SequenceFeature
{
this.type = type;
this.description = desc;
{
this.type = type;
this.description = desc;
- setValue("status", status);
+ setValue(STATUS, status);
this.begin = begin;
this.end = end;
this.featureGroup = featureGroup;
this.begin = begin;
this.end = end;
this.featureGroup = featureGroup;
@@
-291,20
+297,22
@@
public class SequenceFeature
*/
public void setStatus(String status)
{
*/
public void setStatus(String status)
{
- setValue("status", status);
+ setValue(STATUS, status);
}
public String getStatus()
{
}
public String getStatus()
{
- if (otherDetails != null)
- {
- String stat = (String) otherDetails.get("status");
- if (stat != null)
- {
- return new String(stat);
- }
- }
- return null;
+ return (String) getValue(STATUS);
+ }
+
+ public void setAttributes(String attr)
+ {
+ setValue(ATTRIBUTES, attr);
+ }
+
+ public String getAttributes()
+ {
+ return (String) getValue(ATTRIBUTES);
}
public void setPosition(int pos)
}
public void setPosition(int pos)
@@
-329,7
+337,7
@@
public class SequenceFeature
int strand = 0;
if (otherDetails != null)
{
int strand = 0;
if (otherDetails != null)
{
- Object str = otherDetails.get("STRAND");
+ Object str = otherDetails.get(STRAND);
if ("-".equals(str))
{
strand = -1;
if ("-".equals(str))
{
strand = -1;
@@
-342,4
+350,9
@@
public class SequenceFeature
return strand;
}
return strand;
}
+ public void setStrand(String strand)
+ {
+ setValue(STRAND, strand);
+ }
+
}
}