model
Class SequenceImpl

java.lang.Object
  extended by model.SequenceImpl
All Implemented Interfaces:
Sequence

public class SequenceImpl
extends java.lang.Object
implements Sequence

Implementation of the Sequence Interface.


Constructor Summary
SequenceImpl(SequenceImpl seq)
          Copy Constructor
SequenceImpl(java.lang.String name, java.lang.String sequence)
          Constructor for the sequence implementation.
SequenceImpl(java.lang.String name, java.lang.String sequence, int start, int end)
          Constructor for the sequence implementation, where sequence is given as string
 
Method Summary
 int findPosition(int i)
          Finds the i'th position in the sequence, skipping the gaps.
 java.awt.Color getClusterColor()
          Returns the cluster sequence color.
 int getEnd()
          Returns the end position of the sequence.
 int getLength()
          Returns the sequence length.
 char getLetterAt(int i)
          Returns the letter (amino acid) at a certain position.
 java.lang.String getName()
          Returns the sequence name.
 char[] getSequence()
          Returns the sequence as char array.
 char[] getSequence(int start, int end)
          Returns the sequence (for start and end position) as char array.
 java.lang.String getSequenceAsString()
          Returns the sequence as a string.
 int getStart()
          Returns the sequence start position of the sequence.
 boolean isClusterEnd()
          is cluster end boolean.
 boolean isClusterStart()
          Is cluster start boolean.
 void setClusterColor(java.awt.Color clusterColor)
          Sets the cluster sequence color.
 void setClusterEnd(boolean clusterEnd)
          Set the cluster end boolean.
 void setClusterStart(boolean clusterStart)
          Set the cluster start boolean.
 void setEnd(int end)
          Sets the end position of the sequence.
 void setName(java.lang.String name)
          Sets the sequence name.
 void setSequence(char[] sequence)
          Sets the sequence as char array.
 void setSequence(java.lang.String sequence)
          Sets the sequence as string.
 void setStart(int start)
          Sets the start position of the sequence.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SequenceImpl

public SequenceImpl(SequenceImpl seq)
Copy Constructor

Parameters:
seq -

SequenceImpl

public SequenceImpl(java.lang.String name,
                    java.lang.String sequence,
                    int start,
                    int end)
Constructor for the sequence implementation, where sequence is given as string

Parameters:
name -
sequence -
start -
end -

SequenceImpl

public SequenceImpl(java.lang.String name,
                    java.lang.String sequence)
Constructor for the sequence implementation. The whole sequence string is taken from start to end position.

Parameters:
name -
sequence -
Method Detail

getLetterAt

public char getLetterAt(int i)
Returns the letter (amino acid) at a certain position.

Specified by:
getLetterAt in interface Sequence

getStart

public int getStart()
Returns the sequence start position of the sequence.

Specified by:
getStart in interface Sequence

findPosition

public int findPosition(int i)
Finds the i'th position in the sequence, skipping the gaps.

Parameters:
i -
Returns:
pos Integer

setStart

public void setStart(int start)
Sets the start position of the sequence.

Specified by:
setStart in interface Sequence

getEnd

public int getEnd()
Returns the end position of the sequence.

Specified by:
getEnd in interface Sequence

setEnd

public void setEnd(int end)
Sets the end position of the sequence.

Specified by:
setEnd in interface Sequence

getLength

public int getLength()
Returns the sequence length.

Specified by:
getLength in interface Sequence

getName

public java.lang.String getName()
Returns the sequence name.

Specified by:
getName in interface Sequence

setName

public void setName(java.lang.String name)
Sets the sequence name.

Specified by:
setName in interface Sequence

getSequence

public char[] getSequence(int start,
                          int end)
Returns the sequence (for start and end position) as char array.

Specified by:
getSequence in interface Sequence

setSequence

public void setSequence(java.lang.String sequence)
Sets the sequence as string.

Specified by:
setSequence in interface Sequence

setSequence

public void setSequence(char[] sequence)
Sets the sequence as char array.

Parameters:
sequence -

getSequenceAsString

public java.lang.String getSequenceAsString()
Returns the sequence as a string.

Specified by:
getSequenceAsString in interface Sequence

getSequence

public char[] getSequence()
Returns the sequence as char array.

Specified by:
getSequence in interface Sequence

getClusterColor

public java.awt.Color getClusterColor()
Returns the cluster sequence color.

Returns:
clustercolor Color

setClusterColor

public void setClusterColor(java.awt.Color clusterColor)
Sets the cluster sequence color.

Parameters:
clusterColor -

isClusterStart

public boolean isClusterStart()
Is cluster start boolean.

Returns:
clusterStart boolean

setClusterStart

public void setClusterStart(boolean clusterStart)
Set the cluster start boolean.

Parameters:
clusterStart - boolean.

isClusterEnd

public boolean isClusterEnd()
is cluster end boolean.

Returns:
clusterEnd boolean

setClusterEnd

public void setClusterEnd(boolean clusterEnd)
Set the cluster end boolean.

Parameters:
clusterEnd - Boolean