1 package jalview.datamodel;
4 import java.util.Arrays;
5 import java.util.BitSet;
8 public interface ContactMatrixI
11 ContactListI getContactList(int column);
17 String getAnnotDescr();
19 String getAnnotLabel();
22 * string indicating how the contactMatrix should be rendered - stored in
31 public GroupSetI getGroupSet();
33 /// proxy methods to simplify use of the interface
34 /// Mappable contact matrices can override these to perform mapping
36 default public boolean hasGroupSet()
38 return getGroupSet() != null;
41 default boolean hasGroups()
43 return hasGroupSet() && getGroupSet().hasGroups();
46 default BitSet getGroupsFor(int column)
50 BitSet colbitset = new BitSet();
51 colbitset.set(column);
54 return getGroupSet().getGroupsFor(column);
57 default List<BitSet> getGroups()
61 return Arrays.asList();
63 return getGroupSet().getGroups();
66 default boolean hasTree()
68 return hasGroupSet() ? getGroupSet().hasTree() : false;
72 * Newick representation of clustered matrix
74 * @return null unless hasTree is true
76 default String getNewick()
78 return hasGroupSet() ? getGroupSet().getNewick() : null;
81 default String getTreeMethod()
83 return hasGroupSet() ? getGroupSet().getTreeMethod() : null;
86 default boolean hasCutHeight()
88 return hasGroupSet() ? getGroupSet().hasCutHeight() : false;
91 default double getCutHeight()
93 return hasGroupSet() ? getGroupSet().getCutHeight() : 0;
96 default void updateGroups(List<BitSet> colGroups)
100 getGroupSet().updateGroups(colGroups);
104 default void setColorForGroup(BitSet bs, Color color)
108 getGroupSet().setColorForGroup(bs, color);
112 default Color getColourForGroup(BitSet bs)
116 return getGroupSet().getColourForGroup(bs);
124 void setGroupSet(GroupSet makeGroups);