import jalview.datamodel.ContactListI;
import jalview.datamodel.ContactListImpl;
import jalview.datamodel.ContactListProviderI;
+import jalview.datamodel.ContactMatrixI;
import jalview.datamodel.GroupSet;
import jalview.datamodel.GroupSetI;
import jalview.datamodel.Mapping;
public abstract class MappableContactMatrix<T extends MappableContactMatrix<T>>
implements MappableContactMatrixI
{
- SequenceI refSeq = null;
-
- MapList toSeq = null;
-
/**
- * the length that refSeq is expected to be (excluding gaps, of course)
+ * the matrix that is being mapped to
*/
- int length;
+ protected ContactMatrixI mappedMatrix=null;
+
+ public ContactListI getContactList(int column)
+ {
+ return mappedMatrix.getContactList(column);
+ }
+
+ public float getMin()
+ {
+ return mappedMatrix.getMin();
+ }
+
+ public float getMax()
+ {
+ return mappedMatrix.getMax();
+ }
+
+ public int getWidth()
+ {
+ return mappedMatrix.getWidth();
+ }
+
+ public int getHeight()
+ {
+ return mappedMatrix.getHeight();
+ }
@Override
- public boolean hasReferenceSeq()
+ public ContactMatrixI getMappedMatrix()
{
- return (refSeq != null);
+ return mappedMatrix;
}
+
+ @Override
+ public GroupSetI getGroupSet()
+ {
+ return mappedMatrix.getGroupSet();
+ };
@Override
- public SequenceI getReferenceSeq()
+ public void setGroupSet(GroupSet makeGroups)
{
- return refSeq;
+ mappedMatrix.setGroupSet(makeGroups);
}
+
+ /**
+ * the sequence and how it is mapped to the matrix
+ */
+
+ SequenceI refSeq = null;
+
+ MapList toSeq = null;
/**
- * container for groups - defined on matrix columns
+ * the length that refSeq is expected to be (excluding gaps, of course)
*/
- GroupSet grps = new GroupSet();
+ int length;
@Override
- public GroupSetI getGroupSet()
+ public boolean hasReferenceSeq()
{
- return grps;
- };
+ return (refSeq != null);
+ }
@Override
- public void setGroupSet(GroupSet makeGroups)
+ public SequenceI getReferenceSeq()
{
- grps = makeGroups;
+ return refSeq;
}
@Override
}
/**
- * get a specific element of the contact matrix in its data-local coordinates
+ * get a specific element of the underlying contact matrix in its data-local coordinates
* rather than the mapped frame. Implementations are allowed to throw
* RunTimeExceptions if _column/i are out of bounds
*
* @param i
* @return
*/
- protected abstract double getElementAt(int _column, int i);
+ public double getElementAt(int _column, int i) {
+ return mappedMatrix.getElementAt(_column, i);
+ }
}