Class PatternSequenceDatabase


  • public class PatternSequenceDatabase
    extends java.lang.Object
    Implementation of a sequence database, where each sequence is implemented as a list of integers and should have a unique id.
    Author:
    Philipe-Fournier-Viger
    See Also:
    Sequence
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.List<int[]> getSequences()
      Get the sequences from this sequence database.
      void loadFile​(java.lang.String path)
      Method to load a sequence database from a text file in SPMF format.
      void print()
      Print this sequence database to System.out.
      void printDatabaseStats()
      Print statistics about this database.
      void setSequences​(java.util.List<int[]> Sequences)  
      int size()
      Get the sequence count in this database.
      java.lang.String toString()
      Return a string representation of this sequence database.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • PatternSequenceDatabase

        public PatternSequenceDatabase()
    • Method Detail

      • loadFile

        public void loadFile​(java.lang.String path)
                      throws java.io.IOException
        Method to load a sequence database from a text file in SPMF format.
        Parameters:
        path - the input file path.
        Throws:
        java.io.IOException - exception if error while reading the file.
      • print

        public void print()
        Print this sequence database to System.out.
      • setSequences

        public void setSequences​(java.util.List<int[]> Sequences)
      • printDatabaseStats

        public void printDatabaseStats()
        Print statistics about this database.
      • toString

        public java.lang.String toString()
        Return a string representation of this sequence database.
        Overrides:
        toString in class java.lang.Object
      • size

        public int size()
        Get the sequence count in this database.
        Returns:
        the sequence count.
      • getSequences

        public java.util.List<int[]> getSequences()
        Get the sequences from this sequence database.
        Returns:
        A list of sequences (int[]) in SPMF format.