Documentation of 'edu.rit.compbio.seq.Sequence' Java class
Sequence
edu.rit.compbio.seq

Class Sequence

  • Direct Known Subclasses:
    ProteinSequence


    public abstract class Sequence
    extends java.lang.Object
    Class Sequence is the abstract base class for a biological sequence.

    In a program, a sequence is represented as a byte array (type byte[]). For a sequence of length L, the byte array contains L+1 bytes. The byte at index 0 is unused and contains a value of -1. The bytes at indexes 1 through L contain the elements of the sequence. These are generally represented as small integers starting at 0, not as characters.

    • Constructor Summary

      Constructors 
      Constructor and Description
      Sequence()
      Construct a new sequence.
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method and Description
      abstract char charAt(int i)
      Returns a character version of this sequence's element at the given index.
      java.lang.String description()
      Get this sequence's description.
      java.lang.String elementsToString()
      Returns a string version of this sequence's elements.
      boolean equals(java.lang.Object obj)
      Determine if this sequence is equal to the given object.
      int hashCode()
      Returns a hash code for this sequence.
      int length()
      Get this sequence's length L.
      byte[] sequence()
      Get this sequence's elements.
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Sequence

        public Sequence()
        Construct a new sequence.
    • Method Detail

      • description

        public java.lang.String description()
        Get this sequence's description.
        Returns:
        Description string.
      • length

        public int length()
        Get this sequence's length L. This is the number of elements in this sequence.
        Returns:
        Length L.
      • sequence

        public byte[] sequence()
        Get this sequence's elements. The return value is a byte array of length L+1. The byte at index 0 is unused and contains a value of -1. The bytes at indexes 1 through L contain the elements.

        Note: Do not alter the contents of the returned byte array.

        Returns:
        Array of elements.
      • equals

        public boolean equals(java.lang.Object obj)
        Determine if this sequence is equal to the given object. Two sequences are equal if they have the same elements.
        Overrides:
        equals in class java.lang.Object
        Parameters:
        obj - Object to test.
        Returns:
        True if obj is equal to this sequence, false otherwise.
      • hashCode

        public int hashCode()
        Returns a hash code for this sequence.
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        Hash code.
      • charAt

        public abstract char charAt(int i)
        Returns a character version of this sequence's element at the given index.
        Parameters:
        i - Index in the range 1 .. L.
        Returns:
        Character corresponding to element i.
      • elementsToString

        public java.lang.String elementsToString()
        Returns a string version of this sequence's elements.
        Returns:
        String version.

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.