482e0fade17fffb412e0b35cdb0033b1f93218ed
[jalview.git] / src / jalview / datamodel / SequenceCursor.java
1 package jalview.datamodel;
2
3 /**
4  * An immutable object representing one or more residue and corresponding
5  * alignment column positions for a sequence
6  */
7 public class SequenceCursor
8 {
9   /**
10    * the aligned sequence this cursor applies to
11    */
12   public final SequenceI sequence;
13
14   /**
15    * residue position in sequence (start...), 0 if undefined
16    */
17   public final int residuePosition;
18
19   /**
20    * column position (1...) corresponding to residuePosition, or 0 if undefined
21    */
22   public final int columnPosition;
23
24   /**
25    * a token which may be used to check whether this cursor is still valid for
26    * its sequence (allowing it to be ignored if the sequence has changed)
27    */
28   public final int token;
29
30   public SequenceCursor(SequenceI seq, int resPos, int column, int tok)
31   {
32     sequence = seq;
33     residuePosition = resPos;
34     columnPosition = column;
35     token = tok;
36   }
37 }