JAligner

jaligner
Class Sequence

java.lang.Object
  extended byjaligner.Sequence
All Implemented Interfaces:
java.io.Serializable

public class Sequence
extends java.lang.Object
implements java.io.Serializable

A basic (nucleic or protein) sequence. It's a wrapper to String.

Author:
Ahmed Moustafa (ahmed@users.sf.net)
See Also:
Serialized Form

Field Summary
static int NUCLEIC
          Sequence type nucleic.
static int PROTEIN
          Sequence type protein.
 
Constructor Summary
Sequence()
          Constructor
Sequence(java.lang.String sequence)
          Constructor
Sequence(java.lang.String sequence, java.lang.String id, java.lang.String description, int type)
          Constructor
 
Method Summary
 char acidAt(int index)
          Returns the acid at specific location in the sequence
 java.lang.String getDescription()
          Returns the sequence description
 java.lang.String getId()
          Returns the sequence id
 java.lang.String getSequence()
          Returns the sequence string
 int getType()
          Returns the sequence type (nucleic or protein)
 int length()
          Returns the length of the sequence
 void setDescription(java.lang.String description)
          Sets the sequence description
 void setId(java.lang.String id)
          Sets the sequence id
 void setSequence(java.lang.String sequence)
          Sets the sequence string
 void setType(int type)
          Sets the sequence type (nucleic or protein)
 java.lang.String subsequence(int index, int length)
          Returns a subsequence
 char[] toArray()
          Returns the sequence as an array of characters.
 java.lang.String toString()
          Returns the sequence id and the sequence string
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NUCLEIC

public static final int NUCLEIC
Sequence type nucleic.

See Also:
Constant Field Values

PROTEIN

public static final int PROTEIN
Sequence type protein.

See Also:
Constant Field Values
Constructor Detail

Sequence

public Sequence()
Constructor


Sequence

public Sequence(java.lang.String sequence)
Constructor

Parameters:
sequence -

Sequence

public Sequence(java.lang.String sequence,
                java.lang.String id,
                java.lang.String description,
                int type)
Constructor

Parameters:
sequence -
id -
description -
type -
Method Detail

getSequence

public java.lang.String getSequence()
Returns the sequence string

Returns:
Returns the sequence

setSequence

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

Parameters:
sequence - The sequence to set

getId

public java.lang.String getId()
Returns the sequence id

Returns:
Returns the id

setId

public void setId(java.lang.String id)
Sets the sequence id

Parameters:
id - The id to set

getDescription

public java.lang.String getDescription()
Returns the sequence description

Returns:
Returns the description

setDescription

public void setDescription(java.lang.String description)
Sets the sequence description

Parameters:
description - The description to set

getType

public int getType()
Returns the sequence type (nucleic or protein)

Returns:
Returns the type

setType

public void setType(int type)
Sets the sequence type (nucleic or protein)

Parameters:
type - The type to set

length

public int length()
Returns the length of the sequence

Returns:
sequence length

subsequence

public java.lang.String subsequence(int index,
                                    int length)
Returns a subsequence

Parameters:
index - start index
length - length of subsequence
Returns:
subsequence

acidAt

public char acidAt(int index)
Returns the acid at specific location in the sequence

Parameters:
index -
Returns:
acid at index

toArray

public char[] toArray()
Returns the sequence as an array of characters.

Returns:
array of chars.

toString

public java.lang.String toString()
Returns the sequence id and the sequence string

Returns:
Returns the sequence id and the sequence string

JAligner

Ahmed Moustafa (ahmed@users.sf.net)SourceForge.net
The source code of JAligner is licensed under The GNU General Public License (GPL)