From 7ecacfd7a5977fdc69d4e81d5ec24b049ff927e0 Mon Sep 17 00:00:00 2001 From: gmungoc Date: Thu, 14 Apr 2016 12:20:29 +0100 Subject: [PATCH] JAL-2049 small refactor of constructors to avoid code duplication --- src/jalview/datamodel/SequenceFeature.java | 43 ++++++++++++++++++++++++---- 1 file changed, 37 insertions(+), 6 deletions(-) diff --git a/src/jalview/datamodel/SequenceFeature.java b/src/jalview/datamodel/SequenceFeature.java index 4a7706f..4c9aa05 100755 --- a/src/jalview/datamodel/SequenceFeature.java +++ b/src/jalview/datamodel/SequenceFeature.java @@ -111,26 +111,57 @@ public class SequenceFeature } } + /** + * Constructor including a Status value + * + * @param type + * @param desc + * @param status + * @param begin + * @param end + * @param featureGroup + */ public SequenceFeature(String type, String desc, String status, int begin, int end, String featureGroup) { + this(type, desc, begin, end, featureGroup); + setStatus(status); + } + + /** + * Constructor + * + * @param type + * @param desc + * @param begin + * @param end + * @param featureGroup + */ + SequenceFeature(String type, String desc, int begin, int end, + String featureGroup) + { this.type = type; this.description = desc; - setValue(STATUS, status); this.begin = begin; this.end = end; this.featureGroup = featureGroup; } + /** + * Constructor including a score value + * + * @param type + * @param desc + * @param begin + * @param end + * @param score + * @param featureGroup + */ public SequenceFeature(String type, String desc, int begin, int end, float score, String featureGroup) { - this.type = type; - this.description = desc; - this.begin = begin; - this.end = end; + this(type, desc, begin, end, featureGroup); this.score = score; - this.featureGroup = featureGroup; } /** -- 1.7.10.2