Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## de.jstacs.data.sequences
Class SimpleDiscreteSequence

    java.lang.Object
      de.jstacs.data.Sequence<int[]>
          de.jstacs.data.sequences.DiscreteSequence
              de.jstacs.data.sequences.SimpleDiscreteSequence

All Implemented Interfaces:
  Comparable<Sequence<int[]>>

Direct Known Subclasses:
  ByteSequence, IntSequence, MappedDiscreteSequence, ShortSequence, SparseSequence

    public abstract class SimpleDiscreteSequence

extends DiscreteSequence

This is the main class for any discrete sequence.

Author:
  Jens Keilwagen

Nested Class Summary

Nested classes/interfaces inherited from class de.jstacs.data.Sequence
`Sequence.CompositeSequence<T>, Sequence.RecursiveSequence<T>, Sequence.SubSequence<T>`

Field Summary

Fields inherited from class de.jstacs.data.Sequence
`alphabetCon, annotation, rc`

Constructor Summary
`SimpleDiscreteSequence(AlphabetContainer container, SequenceAnnotation[] annotation)` This constructor creates a new `SimpleDiscreteSequence` with the `AlphabetContainer` `container` and the annotation `annotation` but without the content.

Method Summary
`protected void` | `addToRepresentation(Object representation, int pos, String delim)` This method adds the information of one position to the representation using the specified delimiter
`double` | `continuousVal(int pos)` Returns the continuous value at position `pos` of the `Sequence`.
`void` | `fillContainer(int[] container, int pos)` The method fills the content of a specific position in to the container.
`int[]` | `getEmptyContainer()` The method returns a container that can be used for accessing the symbols for each position.
`protected Object` | `getEmptyRepresentation()` Returns an empty representation which is used to create the `String` representation of this instance in the method `Sequence.toString(String, int, int)`.
`protected String` | `getStringRepresentation(Object representation)` This method creates a String representation from the given representation.
`protected int` | `hashCodeForPos(int pos)` This method is used in `Sequence.hashCode()` and the hash code for one specific position.
`boolean` | `isMultiDimensional()` The method returns `true` if the sequence is multidimensional, otherwise .

Methods inherited from class de.jstacs.data.sequences.DiscreteSequence
`compareTo`

Methods inherited from class de.jstacs.data.Sequence
`annotate, compareTo, complement, complement, create, create, create, discreteVal, equals, flatCloneWithoutAnnotation, getAlphabetContainer, getAnnotation, getCompositeSequence, getCompositeSequence, getHammingDistance, getLength, getNumberOfSequenceAnnotationsByType, getSequenceAnnotationByType, getSequenceAnnotationByTypeAndIdentifier, getSubSequence, getSubSequence, getSubSequence, getSubSequence, hashCode, matches, reverse, reverse, reverseComplement, reverseComplement, toDiscrete, toString, toString, toString, toString`

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

Constructor Detail

### SimpleDiscreteSequence

    public SimpleDiscreteSequence(AlphabetContainer container,
                                  SequenceAnnotation[] annotation)
                           throws WrongAlphabetException

  This constructor creates a new `SimpleDiscreteSequence` with the `AlphabetContainer` `container` and the annotation `annotation` but without the content. The content has to be set by the constructor of the subclass.

  Parameters:
    `container` - the `AlphabetContainer` of the sequence
    `annotation` - the annotation of the sequence
  Throws:
    `WrongAlphabetException` - if the `AlphabetContainer` is not discrete
  See Also:
    `Sequence.Sequence(AlphabetContainer, SequenceAnnotation[])`

Method Detail

### continuousVal

    public final double continuousVal(int pos)

  Description copied from class: `Sequence`
  Returns the continuous value at position `pos` of the `Sequence`.

  Specified by:
    `continuousVal` in class `Sequence<int[]>`
  Parameters:
    `pos` - the position of the `Sequence`
  Returns:
    the continuous value at position `pos` of the `Sequence`

### isMultiDimensional

    public boolean isMultiDimensional()

  Description copied from class: `Sequence`
  The method returns `true` if the sequence is multidimensional, otherwise .

  Specified by:
    `isMultiDimensional` in class `Sequence<int[]>`
  Returns:
    `true` if the sequence is multidimensional, otherwise

### getEmptyContainer

    public int[] getEmptyContainer()

  Description copied from class: `Sequence`
  The method returns a container that can be used for accessing the symbols for each position. This is especially of interest for multidimensional sequences.

  Specified by:
    `getEmptyContainer` in class `Sequence<int[]>`
  Returns:
    a container that can be used for accessing the symbols for each position
  See Also:
    `Sequence.fillContainer(Object, int)`, `Sequence.isMultiDimensional()`

### fillContainer

    public void fillContainer(int[] container,
                              int pos)

  Description copied from class: `Sequence`
  The method fills the content of a specific position in to the container. This is especially of interest for multidimensional sequences.

  Specified by:
    `fillContainer` in class `Sequence<int[]>`
  Parameters:
    `container` - the container which is used for filling the content.
    `pos` - the position
  See Also:
    `Sequence.getEmptyContainer()`, `Sequence.isMultiDimensional()`

### getEmptyRepresentation

    protected Object getEmptyRepresentation()

  Description copied from class: `Sequence`
  Returns an empty representation which is used to create the `String` representation of this instance in the method `Sequence.toString(String, int, int)`.

  Specified by:
    `getEmptyRepresentation` in class `Sequence<int[]>`
  Returns:
    an empty representation which is used to create the `String` representation
  See Also:
    `Sequence.toString(String, int, int)`

### addToRepresentation

    protected void addToRepresentation(Object representation,
                                       int pos,
                                       String delim)

  Description copied from class: `Sequence`
  This method adds the information of one position to the representation using the specified delimiter

  Specified by:
    `addToRepresentation` in class `Sequence<int[]>`
  Parameters:
    `representation` - the representation
    `pos` - the position
    `delim` - the delimiter separating the information for different positions
  See Also:
    `Sequence.getEmptyRepresentation()`, `Sequence.toString(String, int, int)`

### getStringRepresentation

    protected String getStringRepresentation(Object representation)

  Description copied from class: `Sequence`
  This method creates a String representation from the given representation.

  Specified by:
    `getStringRepresentation` in class `Sequence<int[]>`
  Parameters:
    `representation` - the representation instance (which should be created by `Sequence.getEmptyContainer()` and filled by `Sequence.addToRepresentation(Object, int, String)`)
  Returns:
    a String representation
  See Also:
    `Sequence.getEmptyRepresentation()`, `Sequence.addToRepresentation(Object, int, String)`, `Sequence.toString(String, int, int)`

### hashCodeForPos

    protected int hashCodeForPos(int pos)

  Description copied from class: `Sequence`
  This method is used in `Sequence.hashCode()` and the hash code for one specific position.

  Specified by:
    `hashCodeForPos` in class `Sequence<int[]>`
  Parameters:
    `pos` - the position
  Returns:
    the hash code for the position

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD