Documentation of 'ca.pfv.spmf.algorithms.sequentialpatterns.clospan_AGP.items.trie.Trie' Java class
Trie
ca.pfv.spmf.algorithms.sequentialpatterns.clospan_AGP.items.trie

Class Trie

  • All Implemented Interfaces:
    java.lang.Comparable<Trie>


    public class Trie
    extends java.lang.Object
    implements java.lang.Comparable<Trie>
    Class that implement a trie structure. A trie is composed of a list of nodes children that are also the beginning of other trie structure. Those nodes are composed of both a ItemAstractionPair object and a Trie, where the children appear. The current trie is referring to a pattern that can be obtained from the root until this one, passing by the different nodes in the way that are ancestors of the current trie. We do not keep any trace of the parent nodes since the whole trie will be run at the end of the algorithm, just before applying the postprocessing step to remove the remaining non-closed frequent patterns. Besides, in a trie we keep some information relative to that pattern that is referred, such as the sequences where the pattern appears, its support, and some other information used in the key generation of the pruning methods. Copyright Antonio Gomariz Peñalver 2013 This file is part of the SPMF DATA MINING SOFTWARE (http://www.philippe-fournier-viger.com/spmf). SPMF is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. SPMF is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with SPMF. If not, see .
    • Constructor Summary

      Constructors 
      Constructor and Description
      Trie()
      Standard constructor of a Trie.
      Trie(java.util.List<TrieNode> nodes)
      Constructor of a Trie by means of a list of NodeTrie.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void addNode(TrieNode node)
      It adds a new node to the list of nodes associated with the Trie
      int compareTo(Trie t)
      Compare this trie to another by id
      void display(javax.swing.tree.DefaultTreeModel model, javax.swing.tree.MutableTreeNode p)
      Method to display graphically the Trie by means of a TreeModel
      java.util.BitSet getAppearingIn()
      It returns the list of sequences Ids where the pattern referred by the Trie appears
      Trie getChild(int index)
      It obtain its ith trie child
      TrieNode getNode(int index)
      It gets the whole TrieNode of the ith child
      java.util.List<TrieNode> getNodes()
      It gets the list of nodes associated with the Trie
      ItemAbstractionPair getPair(int index)
      It gets the pair of the ith child
      int getSumIdSequences()
      It gets the sum of the sequence identifiers of the sequences where the pattern, referred by the Trie, appears
      int getSupport()
      It gets the support of the pattern referred by the Trie.
      int levelSize()
      It returns the number of children that a Trie has
      java.util.List<Pattern> preorderTraversal(Pattern p)
      It makes a pre-order traversal from the Trie.
      boolean remove(int index)
      It removes the ith child of the Trie.
      void removeAll()
      It removes all its descendands tries and then the Trie itself.
      void setAppearingIn(java.util.BitSet appearingIn)
      It updates the list of sequences Ids where the pattern referred by the Trie appears
      void setChild(int index, Trie child)
      It set a child to the Trie given as parameter
      void setNode(int index, TrieNode node)
      It updates the whole TrieNode of the ith child
      void setNodes(java.util.List<TrieNode> nodes)
      It updates the list of nodes associated with the Trie
      void setSumIdSequences(int sumIdSequences)
      It updates the sum of the sequence identifiers of the sequences where the pattern, referred by the Trie, appears
      void setSupport(int support)
      It updates the support of the pattern referred by the Trie
      void sort()
      It sorts the children by lexicographic order (given by their pair values)
      java.lang.String toString()
      Get the string representation of this Trie
      • Methods inherited from class java.lang.Object

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

      • Trie

        public Trie()
        Standard constructor of a Trie. It sets the list of nodes to empty.
      • Trie

        public Trie(java.util.List<TrieNode> nodes)
        Constructor of a Trie by means of a list of NodeTrie.
        Parameters:
        nodes - List of nodes with which we want to initialize the Trie
    • Method Detail

      • getChild

        public Trie getChild(int index)
        It obtain its ith trie child
        Parameters:
        index - Child index in which we are interested
        Returns:
        the ith trie child.
      • setChild

        public void setChild(int index,
                             Trie child)
        It set a child to the Trie given as parameter
        Parameters:
        index - Child index in which we are interested
        child - Trie that we want to insert
      • getNodes

        public java.util.List<TrieNode> getNodes()
        It gets the list of nodes associated with the Trie
        Returns:
        the list of nodes
      • setNodes

        public void setNodes(java.util.List<TrieNode> nodes)
        It updates the list of nodes associated with the Trie
        Parameters:
        nodes - the list of nodes to be used for updating
      • remove

        public boolean remove(int index)
        It removes the ith child of the Trie.
        Parameters:
        index - Child index in which we are interested
        Returns:
        true if the node was removed, otherwise, the index was out of range and no node was removed.
      • getPair

        public ItemAbstractionPair getPair(int index)
        It gets the pair of the ith child
        Parameters:
        index - Child index in which we are interested
        Returns:
        the pair of the ith child
      • getNode

        public TrieNode getNode(int index)
        It gets the whole TrieNode of the ith child
        Parameters:
        index - Child index in which we are interested
        Returns:
        the trie node
      • setNode

        public void setNode(int index,
                            TrieNode node)
        It updates the whole TrieNode of the ith child
        Parameters:
        index - Child index in which we are interested
        node -
      • levelSize

        public int levelSize()
        It returns the number of children that a Trie has
        Returns:
        the number of children
      • removeAll

        public void removeAll()
        It removes all its descendands tries and then the Trie itself.
      • sort

        public void sort()
        It sorts the children by lexicographic order (given by their pair values)
      • getAppearingIn

        public java.util.BitSet getAppearingIn()
        It returns the list of sequences Ids where the pattern referred by the Trie appears
        Returns:
        the list of sequence ids
      • setAppearingIn

        public void setAppearingIn(java.util.BitSet appearingIn)
        It updates the list of sequences Ids where the pattern referred by the Trie appears
        Parameters:
        appearingIn - The list of sequence Ids to update
      • toString

        public java.lang.String toString()
        Get the string representation of this Trie
        Overrides:
        toString in class java.lang.Object
        Returns:
        the string representation
      • getSupport

        public int getSupport()
        It gets the support of the pattern referred by the Trie.
        Returns:
        the support
      • setSupport

        public void setSupport(int support)
        It updates the support of the pattern referred by the Trie
        Parameters:
        support - the support
      • getSumIdSequences

        public int getSumIdSequences()
        It gets the sum of the sequence identifiers of the sequences where the pattern, referred by the Trie, appears
        Returns:
        the sum of sequence identifiers
      • setSumIdSequences

        public void setSumIdSequences(int sumIdSequences)
        It updates the sum of the sequence identifiers of the sequences where the pattern, referred by the Trie, appears
        Parameters:
        sumIdSequences - Value of the sum of sequence identifiers to update
      • preorderTraversal

        public java.util.List<Pattern> preorderTraversal(Pattern p)
        It makes a pre-order traversal from the Trie. The result is concatenate to the prefix pattern given as parameter
        Parameters:
        p - Prefix pattern
        Returns:
        the list of patterns
      • display

        public void display(javax.swing.tree.DefaultTreeModel model,
                            javax.swing.tree.MutableTreeNode p)
        Method to display graphically the Trie by means of a TreeModel
        Parameters:
        model - TreeModel when we want to insert the Trie nodes
        p - TreeNode for the TreeModel
      • compareTo

        public int compareTo(Trie t)
        Compare this trie to another by id
        Specified by:
        compareTo in interface java.lang.Comparable<Trie>
        Parameters:
        t - the other trie
        Returns:
        0 if the id is the same, -1 if the id of this trie is smaller, otherwise 1.
      • addNode

        public void addNode(TrieNode node)
        It adds a new node to the list of nodes associated with the Trie
        Parameters:
        node -

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.