ca.pfv.spmf.algorithms.sequentialpatterns.fournier2008_seqdim
Class SequenceDatabase
- java.lang.Object
-
- ca.pfv.spmf.algorithms.sequentialpatterns.fournier2008_seqdim.SequenceDatabase
-
public class SequenceDatabase extends java.lang.ObjectImplementation of a sequence database as used by the SeqDim and Fournier-Vier (2008) algorithms. Each sequence need to hvae a unique ID. See examples in the /test/ directory for the format of input files. that can be read by this class.- See Also:
AlgoFournierViger08,AlgoSeqDim,Sequence
-
-
Constructor Summary
Constructors Constructor and Description SequenceDatabase()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidaddSequence(Sequence sequence)Add a sequence to the sequence databasejava.util.Set<java.lang.Integer>getSequenceIDs()Get the set of sequence IDs.java.util.List<Sequence>getSequences()Get the list of sequences.voidloadFile(java.lang.String path)Load a sequence database from an input filevoidprint()Print this sequence database to System.outintsize()Get the number of sequences.java.lang.StringtoString()Get a string representation of this sequence
-
-
-
Method Detail
-
loadFile
public void loadFile(java.lang.String path) throws java.io.IOExceptionLoad a sequence database from an input file- Parameters:
path- the input file path- Throws:
java.io.IOException- exception if error reading file
-
addSequence
public void addSequence(Sequence sequence)
Add a sequence to the sequence database- Parameters:
sequence- the sequence
-
print
public void print()
Print this sequence database to System.out
-
toString
public java.lang.String toString()
Get a string representation of this sequence- Overrides:
toStringin classjava.lang.Object
-
size
public int size()
Get the number of sequences.- Returns:
- an integer
-
getSequences
public java.util.List<Sequence> getSequences()
Get the list of sequences.- Returns:
- a List of sequences.
-
getSequenceIDs
public java.util.Set<java.lang.Integer> getSequenceIDs()
Get the set of sequence IDs.- Returns:
- a Set of Integer.
-
-
DMelt 3.0 © DataMelt by jWork.ORG