From d6acbafc10c767f3bf58092258ca6ed0fd4c8dc2 Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Fri, 10 Jun 2022 12:55:26 +0100 Subject: [PATCH] JAL-4027 getter for contact matrices on the Alignment. --- src/jalview/datamodel/Alignment.java | 12 ++++++++++++ src/jalview/datamodel/AlignmentI.java | 3 +++ 2 files changed, 15 insertions(+) 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(); } -- 1.7.10.2