de.unibi.techfak.jpredictor.sequences
Class Sequence

java.lang.Object
  extended by de.unibi.techfak.jpredictor.sequences.MappedCharSequence
      extended by de.unibi.techfak.jpredictor.sequences.Sequence
All Implemented Interfaces:
java.lang.CharSequence

public class Sequence
extends MappedCharSequence

This class represents a sequence of DNA or RNA. For this purpose, MappedCharSequence is extended with name and description.
A sequence can be obtained by calling nextSequence() from classes that implement the interface SequenceEnumeration.

See Also:
SequenceEnumeration

Field Summary
private  java.lang.String description
          The description of this sequence.
private  java.lang.String name
          The name of the sequence.
 
Fields inherited from class de.unibi.techfak.jpredictor.sequences.MappedCharSequence
length
 
Constructor Summary
protected Sequence(java.io.Reader reader, SequenceInformationBlock ssb)
          Sets the underlying reader, which must not be null and a SequenceInformationBlock.
  Sequence(java.lang.String name, java.lang.String description, java.io.Reader reader)
          Sets the underlying Reader, which must not be null and the name and description of that sequence.
  Sequence(java.lang.String name, java.lang.String description, java.lang.String filename)
          The filename is taken to open the file.
 
Method Summary
 java.lang.String getDescription()
          Gets the description of this sequence.
 java.lang.String getName()
          Gets the name of this sequence.
 void setDescription(java.lang.String description)
          Sets the description of the current sequence.
 void setName(java.lang.String name)
          Sets a new name for the sequence.
 
Methods inherited from class de.unibi.techfak.jpredictor.sequences.MappedCharSequence
charAt, getBufferSize, getReader, length, subSequence, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

name

private java.lang.String name
The name of the sequence.


description

private java.lang.String description
The description of this sequence.

Constructor Detail

Sequence

public Sequence(java.lang.String name,
                java.lang.String description,
                java.io.Reader reader)
         throws java.lang.NullPointerException
Sets the underlying Reader, which must not be null and the name and description of that sequence.

Parameters:
name - The name of the sequence to be generated.
description - A short description what the sequence contains.
reader - The Reader all data comes from.
Throws:
java.lang.NullPointerException - If reader is null.

Sequence

public Sequence(java.lang.String name,
                java.lang.String description,
                java.lang.String filename)
         throws java.io.FileNotFoundException,
                java.lang.NullPointerException
The filename is taken to open the file. Sets the name and description of the sequence.

Parameters:
name - The name of the sequence.
description - A short description of the sequence.
filename - The name of the file to be opened.
Throws:
java.io.FileNotFoundException - If the file could not be found.
java.lang.NullPointerException - If filename is null.

Sequence

protected Sequence(java.io.Reader reader,
                   SequenceInformationBlock ssb)
            throws java.lang.NullPointerException
Sets the underlying reader, which must not be null and a SequenceInformationBlock. This method is normally called by the SequenceEnumarator-class.

Parameters:
reader - The Reader all data comes from.
ssb - Gives informations about the reader's dimensions.
Throws:
java.lang.NullPointerException - If reader is null.
Method Detail

getName

public java.lang.String getName()
Gets the name of this sequence.

Returns:
The sequence' name.

setName

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

Parameters:
name - The new name.

getDescription

public java.lang.String getDescription()
Gets the description of this sequence.

Returns:
The sequence's description.

setDescription

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

Parameters:
description - The new description.