formatting
[jalview.git] / src / jalview / datamodel / AlignmentI.java
index 7e55e36..d35d3f7 100755 (executable)
@@ -26,14 +26,14 @@ public interface AlignmentI extends AnnotatedCollectionI
 {
   /**
    * Calculates the number of sequences in an alignment
-   *
+   * 
    * @return Number of sequences in alignment
    */
   public int getHeight();
 
   /**
    * Calculates the maximum width of the alignment, including gaps.
-   *
+   * 
    * @return Greatest sequence length within alignment.
    */
   @Override
@@ -42,14 +42,14 @@ public interface AlignmentI extends AnnotatedCollectionI
   /**
    * Calculates if this set of sequences (visible and invisible) are all the
    * same length
-   *
+   * 
    * @return true if all sequences in alignment are the same length
    */
   public boolean isAligned();
 
   /**
    * Calculates if this set of sequences is all the same length
-   *
+   * 
    * @param includeHidden
    *          optionally exclude hidden sequences from test
    * @return true if all (or just visible) sequences are the same length
@@ -58,7 +58,7 @@ public interface AlignmentI extends AnnotatedCollectionI
 
   /**
    * Gets sequences as a Synchronized collection
-   *
+   * 
    * @return All sequences in alignment.
    */
   @Override
@@ -66,33 +66,32 @@ public interface AlignmentI extends AnnotatedCollectionI
 
   /**
    * Gets sequences as a SequenceI[]
-   *
+   * 
    * @return All sequences in alignment.
    */
   public SequenceI[] getSequencesArray();
 
   /**
    * Find a specific sequence in this alignment.
-   *
+   * 
    * @param i
    *          Index of required sequence.
-   *
+   * 
    * @return SequenceI at given index.
    */
   public SequenceI getSequenceAt(int i);
 
   /**
    * Add a new sequence to this alignment.
-   *
+   * 
    * @param seq
    *          New sequence will be added at end of alignment.
    */
   public void addSequence(SequenceI seq);
 
-
   /**
    * Used to set a particular index of the alignment with the given sequence.
-   *
+   * 
    * @param i
    *          Index of sequence to be updated.
    * @param seq
@@ -102,7 +101,7 @@ public interface AlignmentI extends AnnotatedCollectionI
 
   /**
    * Deletes a sequence from the alignment
-   *
+   * 
    * @param s
    *          Sequence to be deleted.
    */
@@ -110,7 +109,7 @@ public interface AlignmentI extends AnnotatedCollectionI
 
   /**
    * Deletes a sequence from the alignment.
-   *
+   * 
    * @param i
    *          Index of sequence to be deleted.
    */
@@ -118,10 +117,10 @@ public interface AlignmentI extends AnnotatedCollectionI
 
   /**
    * Finds sequence in alignment using sequence name as query.
-   *
+   * 
    * @param name
    *          Id of sequence to search for.
-   *
+   * 
    * @return Sequence matching query, if found. If not found returns null.
    */
   public SequenceI findName(String name);
@@ -130,20 +129,20 @@ public interface AlignmentI extends AnnotatedCollectionI
 
   /**
    * Finds index of a given sequence in the alignment.
-   *
+   * 
    * @param s
    *          Sequence to look for.
-   *
+   * 
    * @return Index of sequence within the alignment or -1 if not found
    */
   public int findIndex(SequenceI s);
 
   /**
    * Finds group that given sequence is part of.
-   *
+   * 
    * @param s
    *          Sequence in alignment.
-   *
+   * 
    * @return First group found for sequence. WARNING : Sequences may be members
    *         of several groups. This method is incomplete.
    */
@@ -151,17 +150,17 @@ public interface AlignmentI extends AnnotatedCollectionI
 
   /**
    * Finds all groups that a given sequence is part of.
-   *
+   * 
    * @param s
    *          Sequence in alignment.
-   *
+   * 
    * @return All groups containing given sequence.
    */
   public SequenceGroup[] findAllGroups(SequenceI s);
 
   /**
    * Adds a new SequenceGroup to this alignment.
-   *
+   * 
    * @param sg
    *          New group to be added.
    */
@@ -169,7 +168,7 @@ public interface AlignmentI extends AnnotatedCollectionI
 
   /**
    * Deletes a specific SequenceGroup
-   *
+   * 
    * @param g
    *          Group will be deleted from alignment.
    */
@@ -177,7 +176,7 @@ public interface AlignmentI extends AnnotatedCollectionI
 
   /**
    * Get all the groups associated with this alignment.
-   *
+   * 
    * @return All groups as a list.
    */
   public List<SequenceGroup> getGroups();
@@ -189,7 +188,7 @@ public interface AlignmentI extends AnnotatedCollectionI
 
   /**
    * Adds a new AlignmentAnnotation to this alignment
-   *
+   * 
    * @note Care should be taken to ensure that annotation is at least as wide as
    *       the longest sequence in the alignment for rendering purposes.
    */
@@ -197,7 +196,7 @@ public interface AlignmentI extends AnnotatedCollectionI
 
   /**
    * moves annotation to a specified index in alignment annotation display stack
-   *
+   * 
    * @param aa
    *          the annotation object to be moved
    * @param index
@@ -210,7 +209,7 @@ public interface AlignmentI extends AnnotatedCollectionI
    * reference from any SequenceI or SequenceGroup object's annotation if and
    * only if aa is contained within the alignment's annotation vector.
    * Otherwise, it will do nothing.
-   *
+   * 
    * @param aa
    *          the annotation to delete
    * @return true if annotation was deleted from this alignment.
@@ -222,7 +221,7 @@ public interface AlignmentI extends AnnotatedCollectionI
    * removes any reference from any SequenceI or SequenceGroup object's
    * annotation if and only if aa is contained within the alignment's annotation
    * vector. Otherwise, it will do nothing.
-   *
+   * 
    * @param aa
    *          the annotation to delete
    * @param unhook
@@ -236,7 +235,7 @@ public interface AlignmentI extends AnnotatedCollectionI
   /**
    * Get the annotation associated with this alignment (this can be null if no
    * annotation has ever been created on the alignment)
-   *
+   * 
    * @return array of AlignmentAnnotation objects
    */
   @Override
@@ -244,7 +243,7 @@ public interface AlignmentI extends AnnotatedCollectionI
 
   /**
    * Change the gap character used in this alignment to 'gc'
-   *
+   * 
    * @param gc
    *          the new gap character.
    */
@@ -252,34 +251,34 @@ public interface AlignmentI extends AnnotatedCollectionI
 
   /**
    * Get the gap character used in this alignment
-   *
+   * 
    * @return gap character
    */
   public char getGapCharacter();
 
   /**
    * Test for all nucleotide alignment
-   *
+   * 
    * @return true if alignment is nucleotide sequence
    */
   public boolean isNucleotide();
 
   /**
    * Test if alignment contains RNA structure
-   *
+   * 
    * @return true if RNA structure AligmnentAnnotation was added to alignment
    */
   public boolean hasRNAStructure();
 
   /**
    * Set alignment to be a nucleotide sequence
-   *
+   * 
    */
   public void setNucleotide(boolean b);
 
   /**
    * Get the associated dataset for the alignment.
-   *
+   * 
    * @return Alignment containing dataset sequences or null of this is a
    *         dataset.
    */
@@ -287,7 +286,7 @@ public interface AlignmentI extends AnnotatedCollectionI
 
   /**
    * Set the associated dataset for the alignment, or create one.
-   *
+   * 
    * @param dataset
    *          The dataset alignment or null to construct one.
    */
@@ -295,7 +294,7 @@ public interface AlignmentI extends AnnotatedCollectionI
 
   /**
    * pads sequences with gaps (to ensure the set looks like an alignment)
-   *
+   * 
    * @return boolean true if alignment was modified
    */
   public boolean padGaps();
@@ -304,7 +303,7 @@ public interface AlignmentI extends AnnotatedCollectionI
 
   /**
    * Compact representation of alignment
-   *
+   * 
    * @return CigarArray
    */
   public CigarArray getCompactAlignment();
@@ -312,7 +311,7 @@ public interface AlignmentI extends AnnotatedCollectionI
   /**
    * Set an arbitrary key value pair for an alignment. Note: both key and value
    * objects should return a meaningful, human readable response to .toString()
-   *
+   * 
    * @param key
    * @param value
    */
@@ -320,7 +319,7 @@ public interface AlignmentI extends AnnotatedCollectionI
 
   /**
    * Get a named property from the alignment.
-   *
+   * 
    * @param key
    * @return value of property
    */
@@ -328,21 +327,21 @@ public interface AlignmentI extends AnnotatedCollectionI
 
   /**
    * Get the property hashtable.
-   *
+   * 
    * @return hashtable of alignment properties (or null if none are defined)
    */
   public Hashtable getProperties();
 
   /**
    * add a reference to a frame of aligned codons for this alignment
-   *
+   * 
    * @param codons
    */
   public void addCodonFrame(AlignedCodonFrame codons);
 
   /**
    * remove a particular codon frame reference from this alignment
-   *
+   * 
    * @param codons
    * @return true if codon frame was removed.
    */
@@ -350,14 +349,14 @@ public interface AlignmentI extends AnnotatedCollectionI
 
   /**
    * get all codon frames associated with this alignment
-   *
+   * 
    * @return
    */
   public AlignedCodonFrame[] getCodonFrames();
 
   /**
    * get a particular codon frame
-   *
+   * 
    * @param index
    * @return
    */
@@ -370,7 +369,7 @@ public interface AlignmentI extends AnnotatedCollectionI
 
   /**
    * find sequence with given name in alignment
-   *
+   * 
    * @param token
    *          name to find
    * @param b
@@ -383,7 +382,7 @@ public interface AlignmentI extends AnnotatedCollectionI
   /**
    * find next sequence with given name in alignment starting after a given
    * sequence
-   *
+   * 
    * @param startAfter
    *          the sequence after which the search will be started (usually the
    *          result of the last call to findName)
@@ -399,7 +398,7 @@ public interface AlignmentI extends AnnotatedCollectionI
   /**
    * find first sequence in alignment which is involved in the given search
    * result object
-   *
+   * 
    * @param results
    * @return -1 or index of sequence in alignment
    */
@@ -412,7 +411,7 @@ public interface AlignmentI extends AnnotatedCollectionI
    * gap characters, etc...). If you are uncertain, use the copy Alignment copy
    * constructor to create a new version which can be appended without side
    * effect.
-   *
+   * 
    * @param toappend
    *          - the alignment to be appended.
    */
@@ -421,7 +420,7 @@ public interface AlignmentI extends AnnotatedCollectionI
   /**
    * Justify the sequences to the left or right by deleting and inserting gaps
    * before the initial residue or after the terminal residue
-   *
+   * 
    * @param right
    *          true if alignment padded to right, false to justify to left
    * @return true if alignment was changed TODO: return undo object
@@ -430,7 +429,7 @@ public interface AlignmentI extends AnnotatedCollectionI
 
   /**
    * add given annotation row at given position (0 is start, -1 is end)
-   *
+   * 
    * @param consensus
    * @param i
    */
@@ -438,21 +437,31 @@ public interface AlignmentI extends AnnotatedCollectionI
 
   /**
    * search for or create a specific annotation row on the alignment
-   * @param name name for annotation (must match)
-   * @param calcId calcId for the annotation (null or must match)
-   * @param autoCalc - value of autocalc flag for the annotation
-   * @param seqRef - null or specific sequence reference
-   * @param groupRef - null or specific group reference
-   * @param method - CalcId for the annotation (must match)
-   *
+   * 
+   * @param name
+   *          name for annotation (must match)
+   * @param calcId
+   *          calcId for the annotation (null or must match)
+   * @param autoCalc
+   *          - value of autocalc flag for the annotation
+   * @param seqRef
+   *          - null or specific sequence reference
+   * @param groupRef
+   *          - null or specific group reference
+   * @param method
+   *          - CalcId for the annotation (must match)
+   * 
    * @return existing annotation matching the given attributes
    */
-  public AlignmentAnnotation findOrCreateAnnotation(String name, String calcId,
-          boolean autoCalc, SequenceI seqRef, SequenceGroup groupRef);
+  public AlignmentAnnotation findOrCreateAnnotation(String name,
+          String calcId, boolean autoCalc, SequenceI seqRef,
+          SequenceGroup groupRef);
 
   /**
-   * move the given group up or down in the alignment by the given number of rows.
-   * Implementor assumes given group is already present on alignment - no recalculations are triggered.
+   * move the given group up or down in the alignment by the given number of
+   * rows. Implementor assumes given group is already present on alignment - no
+   * recalculations are triggered.
+   * 
    * @param sg
    * @param map
    * @param up