JAL-1705 isEmpty() and (debug) toString() methods added
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Thu, 21 Jan 2016 14:29:42 +0000 (14:29 +0000)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Thu, 21 Jan 2016 14:29:42 +0000 (14:29 +0000)
src/jalview/datamodel/AlignedCodonFrame.java

index 10632c5..5dfd434 100644 (file)
@@ -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<SequenceToSequenceMapping> mappings;
@@ -617,4 +627,14 @@ public class AlignedCodonFrame
       }
     }
   }
+
+  /**
+   * Answers true if this object contains no mappings
+   * 
+   * @return
+   */
+  public boolean isEmpty()
+  {
+    return mappings.isEmpty();
+  }
 }