From: Jim Procter Date: Sun, 18 Jan 2015 11:27:30 +0000 (+0000) Subject: JAL-1372 JAL-1114 JAL-1628 tidy sequenceI/sequence X-Git-Tag: Jalview_2_9~108^2~26 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;ds=sidebyside;h=393316810f2e54f069863145fb35102c6e889d50;p=jalview.git JAL-1372 JAL-1114 JAL-1628 tidy sequenceI/sequence --- diff --git a/src/jalview/datamodel/Sequence.java b/src/jalview/datamodel/Sequence.java index 0652fb5..cf1c983 100755 --- a/src/jalview/datamodel/Sequence.java +++ b/src/jalview/datamodel/Sequence.java @@ -661,11 +661,7 @@ public class Sequence implements SequenceI return map; } - /* - * (non-Javadoc) - * - * @see jalview.datamodel.SequenceI#findPositionMap() - */ + @Override public int[] findPositionMap() { int map[] = new int[sequence.length]; @@ -685,11 +681,7 @@ public class Sequence implements SequenceI return map; } - /* - * (non-Javadoc) - * - * @see jalview.datamodel.SequenceI#deleteChars(int, int) - */ + @Override public void deleteChars(int i, int j) { int newstart = start, newend = end; @@ -768,16 +760,7 @@ public class Sequence implements SequenceI sequence = tmp; } - /** - * DOCUMENT ME! - * - * @param i - * DOCUMENT ME! - * @param c - * DOCUMENT ME! - * @param chop - * DOCUMENT ME! - */ + @Override public void insertCharAt(int i, int length, char c) { char[] tmp = new char[sequence.length + length]; @@ -807,26 +790,31 @@ public class Sequence implements SequenceI sequence = tmp; } + @Override public void insertCharAt(int i, char c) { insertCharAt(i, 1, c); } + @Override public String getVamsasId() { return vamsasId; } + @Override public void setVamsasId(String id) { vamsasId = id; } + @Override public void setDBRef(DBRefEntry[] dbref) { dbrefs = dbref; } + @Override public DBRefEntry[] getDBRef() { if (dbrefs == null && datasetSequence != null @@ -837,6 +825,7 @@ public class Sequence implements SequenceI return dbrefs; } + @Override public void addDBRef(DBRefEntry entry) { if (dbrefs == null) @@ -869,40 +858,33 @@ public class Sequence implements SequenceI dbrefs = temp; } + @Override public void setDatasetSequence(SequenceI seq) { datasetSequence = seq; } + @Override public SequenceI getDatasetSequence() { return datasetSequence; } - /** - * Returns a new array containing this sequence's annotations, or null. - */ + @Override public AlignmentAnnotation[] getAnnotation() { return annotation == null ? null : annotation .toArray(new AlignmentAnnotation[annotation.size()]); } - /** - * Returns true if this sequence has the given annotation (by object - * identity). - */ + @Override public boolean hasAnnotation(AlignmentAnnotation ann) { return annotation == null ? false : annotation.contains(ann); } - /** - * Add the given annotation, if not already added, and set its sequence ref to - * be this sequence. Does nothing if this sequence's annotations already - * include this annotation (by identical object reference). - */ + @Override public void addAlignmentAnnotation(AlignmentAnnotation annotation) { if (this.annotation == null) @@ -948,11 +930,7 @@ public class Sequence implements SequenceI return true; } - /* - * (non-Javadoc) - * - * @see jalview.datamodel.SequenceI#deriveSequence() - */ + @Override public SequenceI deriveSequence() { SequenceI seq = new Sequence(this); @@ -1043,11 +1021,7 @@ public class Sequence implements SequenceI } } - /* - * (non-Javadoc) - * - * @see jalview.datamodel.SequenceI#getAnnotation(java.lang.String) - */ + @Override public AlignmentAnnotation[] getAnnotation(String label) { if (annotation == null || annotation.size() == 0) @@ -1080,6 +1054,7 @@ public class Sequence implements SequenceI return anns; } + @Override public boolean updatePDBIds() { if (datasetSequence != null) @@ -1133,13 +1108,7 @@ public class Sequence implements SequenceI return false; } - /* - * (non-Javadoc) - * - * @see - * jalview.datamodel.SequenceI#transferAnnotation(jalview.datamodel.SequenceI, - * jalview.datamodel.Mapping) - */ + @Override public void transferAnnotation(SequenceI entry, Mapping mp) { if (datasetSequence != null) @@ -1235,13 +1204,6 @@ public class Sequence implements SequenceI return rna; } - /** - * Returns a (possibly empty) list of any annotations that match on given - * calcId (source) and label (type). Null values do not match. - * - * @param calcId - * @param label - */ @Override public List getAlignmentAnnotations(String calcId, String label) diff --git a/src/jalview/datamodel/SequenceI.java b/src/jalview/datamodel/SequenceI.java index fc67efd..46669ae 100755 --- a/src/jalview/datamodel/SequenceI.java +++ b/src/jalview/datamodel/SequenceI.java @@ -315,10 +315,22 @@ public interface SequenceI public SequenceI getDatasetSequence(); + /** + * Returns a new array containing this sequence's annotations, or null. + */ public AlignmentAnnotation[] getAnnotation(); + /** + * Returns true if this sequence has the given annotation (by object + * identity). + */ public boolean hasAnnotation(AlignmentAnnotation ann); + /** + * Add the given annotation, if not already added, and set its sequence ref to + * be this sequence. Does nothing if this sequence's annotations already + * include this annotation (by identical object reference). + */ public void addAlignmentAnnotation(AlignmentAnnotation annotation); public void removeAlignmentAnnotation(AlignmentAnnotation annotation); @@ -347,12 +359,11 @@ public interface SequenceI public AlignmentAnnotation[] getAnnotation(String label); /** - * Return a list of any annotations which match the given calcId (source) and - * label (type). Null values do not match. + * Returns a (possibly empty) list of any annotations that match on given + * calcId (source) and label (type). Null values do not match. * * @param calcId * @param label - * @return */ public List getAlignmentAnnotations(String calcId, String label);