From 36394666b7848eb7c2569188dad062c7d450d612 Mon Sep 17 00:00:00 2001 From: gmungoc Date: Thu, 21 Jan 2016 14:29:42 +0000 Subject: [PATCH] JAL-1705 isEmpty() and (debug) toString() methods added --- src/jalview/datamodel/AlignedCodonFrame.java | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/jalview/datamodel/AlignedCodonFrame.java b/src/jalview/datamodel/AlignedCodonFrame.java index 10632c5..5dfd434 100644 --- a/src/jalview/datamodel/AlignedCodonFrame.java +++ b/src/jalview/datamodel/AlignedCodonFrame.java @@ -47,6 +47,16 @@ public class AlignedCodonFrame this.fromSeq = from; this.mapping = map; } + + /** + * Readable representation for debugging only, not guaranteed not to change + */ + @Override + public String toString() + { + return String.format("From %s %s", fromSeq.getName(), + mapping.toString()); + } } private List mappings; @@ -617,4 +627,14 @@ public class AlignedCodonFrame } } } + + /** + * Answers true if this object contains no mappings + * + * @return + */ + public boolean isEmpty() + { + return mappings.isEmpty(); + } } -- 1.7.10.2