From: Jim Procter Date: Fri, 10 Jun 2022 11:55:26 +0000 (+0100) Subject: JAL-4027 getter for contact matrices on the Alignment. X-Git-Tag: Release_2_11_4_0~560 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=d6acbafc10c767f3bf58092258ca6ed0fd4c8dc2;p=jalview.git JAL-4027 getter for contact matrices on the Alignment. --- diff --git a/src/jalview/datamodel/Alignment.java b/src/jalview/datamodel/Alignment.java index ea04361..0aa8424 100755 --- a/src/jalview/datamodel/Alignment.java +++ b/src/jalview/datamodel/Alignment.java @@ -23,6 +23,7 @@ package jalview.datamodel; import java.util.ArrayList; import java.util.Arrays; import java.util.BitSet; +import java.util.Collection; import java.util.Collections; import java.util.Enumeration; import java.util.HashMap; @@ -2034,6 +2035,17 @@ public class Alignment implements AlignmentI, AutoCloseable } Map contactmaps = new HashMap<>(); + + @Override + public Collection getContactMaps() + { + if (contactmaps != null && contactmaps.size() > 0) + { + return contactmaps.values(); + } + return Collections.EMPTY_LIST; + } + @Override public ContactListI getContactListFor(AlignmentAnnotation _aa, int column) { diff --git a/src/jalview/datamodel/AlignmentI.java b/src/jalview/datamodel/AlignmentI.java index 862a2bf..93a8c26 100755 --- a/src/jalview/datamodel/AlignmentI.java +++ b/src/jalview/datamodel/AlignmentI.java @@ -20,6 +20,7 @@ */ package jalview.datamodel; +import java.util.Collection; import java.util.Hashtable; import java.util.List; import java.util.Map; @@ -635,4 +636,6 @@ public interface AlignmentI extends AnnotatedCollectionI ContactListI getContactListFor(AlignmentAnnotation _aa, int column); AlignmentAnnotation addContactList(ContactMatrixI cm); + + Collection getContactMaps(); }