Documentation of 'ca.pfv.spmf.algorithms.sequentialpatterns.gsp_AGP.items.Sequence' Java class
Sequence
ca.pfv.spmf.algorithms.sequentialpatterns.gsp_AGP.items

Class Sequence



  • public class Sequence
    extends java.lang.Object
    Inspired in SPMF Implementation of a sequence. A sequence is defined as a list of itemsets and can have an identifier. 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
      Sequence(int id)
      Constructor for a Sequence.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void addItem(int indexItemset, int indexItem, Item item)
      Add an item in the specified position of the specified itemset
      void addItem(int indexItemset, Item item)
      Adds an item to the specified itemset
      void addItem(Item item)
      Adds an item to the last itemset of de sequence.
      void addItemset(Itemset itemset)
      Adds an itemset in the sequence.
      Sequence cloneSequence()
      It clones a sequence
      Itemset get(int index)
      It gets the ith itemset of this sequence
      int getId()
      It returns the sequence identifier
      java.util.List<Itemset> getItemsets()
      Obtains a list the itemsets that compose the sequence
      int getLength()
      The number of items that compose the sequence
      long getTimeLength()
      Get the time length of the sequence.
      int numberOfItemsAfterPositionIth(int itemsetIndex, int itemIndex)
      It gives the number of items that appears after a concrete position of the sequence
      Itemset remove(int indexItemset)
      It removes a specified itemset
      Item remove(int indexItemset, int indexItem)
      It removes a specified item in a specified itemset.
      void remove(int indexItemset, Item item)
      It removes a specified item in a specified itemset.
      int[] SearchForItemAtTheSameItemset(Item item, int itemsetIndex, int itemIndex)
      It returns a pair indicanting the appearance of an item in the itemset given as parameter.
      int[] searchForItemInAConcreteTemporalDistance(Item item, int itemsetIndex, int itemIndex, long temporalDistance)
      It returns a pair indicanting the first appearance of an item in the sequence that appears in a itemset that has a temporal distance with respect to the current itemset, as it the given parameter.
      int[] searchForTheFirstAppearance(int itemsetIndex, int itemIndex, Item item)
      It returns a pair indicanting the first appearance of an item in the sequence.
      int size()
      The number of itemsets that compose the sequence
      java.lang.String toString()
      The sequence as a string
      • Methods inherited from class java.lang.Object

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

      • Sequence

        public Sequence(int id)
        Constructor for a Sequence.
        Parameters:
        id - an integer identifier
    • Method Detail

      • addItemset

        public void addItemset(Itemset itemset)
        Adds an itemset in the sequence. The itemset is inserte at the end of the sequence
        Parameters:
        itemset - the itemset to add
      • addItem

        public void addItem(Item item)
        Adds an item to the last itemset of de sequence.
        Parameters:
        item -
      • addItem

        public void addItem(int indexItemset,
                            Item item)
        Adds an item to the specified itemset
        Parameters:
        indexItemset - itemset where we want to add the item
        item - item to add
      • addItem

        public void addItem(int indexItemset,
                            int indexItem,
                            Item item)
        Add an item in the specified position of the specified itemset
        Parameters:
        indexItemset - Index of the itemset where we want to add the item
        indexItem - Position in the itemset where we want to add the item
        item - item to add
      • remove

        public Itemset remove(int indexItemset)
        It removes a specified itemset
        Parameters:
        indexItemset - index of the itemset that we want to remove
        Returns:
        the removed itemset
      • remove

        public Item remove(int indexItemset,
                           int indexItem)
        It removes a specified item in a specified itemset.
        Parameters:
        indexItemset - index of the itemset where we want to remove an item
        indexItem - index of the item that we want to remove
        Returns:
        the removed item
      • remove

        public void remove(int indexItemset,
                           Item item)
        It removes a specified item in a specified itemset.
        Parameters:
        indexItemset - index of the itemset where we want to remove an item
        item - item to remove
      • cloneSequence

        public Sequence cloneSequence()
        It clones a sequence
        Returns:
        the cloned sequence
      • toString

        public java.lang.String toString()
        The sequence as a string
        Overrides:
        toString in class java.lang.Object
        Returns:
        the string
      • getId

        public int getId()
        It returns the sequence identifier
        Returns:
        the sequence id of this sequence
      • getItemsets

        public java.util.List<Itemset> getItemsets()
        Obtains a list the itemsets that compose the sequence
        Returns:
        the list of itemsets
      • get

        public Itemset get(int index)
        It gets the ith itemset of this sequence
        Parameters:
        index - the index i
        Returns:
        the itemset
      • size

        public int size()
        The number of itemsets that compose the sequence
        Returns:
        the number of itemsets
      • getLength

        public int getLength()
        The number of items that compose the sequence
        Returns:
        the number of items
      • getTimeLength

        public long getTimeLength()
        Get the time length of the sequence. It is equal to the last itemset timestamp minus the first itemset timestamp
        Returns:
        the time length
      • searchForTheFirstAppearance

        public int[] searchForTheFirstAppearance(int itemsetIndex,
                                                 int itemIndex,
                                                 Item item)
        It returns a pair indicanting the first appearance of an item in the sequence. The starting point where the method takes the search up is given as parameter.
        Parameters:
        itemsetIndex - Index of the first itemset where we will start to search
        itemIndex - Index of the first item where we will start to search
        item - Item to find
        Returns:
        the pair position if the item is found, otherwise null value
      • SearchForItemAtTheSameItemset

        public int[] SearchForItemAtTheSameItemset(Item item,
                                                   int itemsetIndex,
                                                   int itemIndex)
        It returns a pair indicanting the appearance of an item in the itemset given as parameter. The starting point where the method takes the search up is given as parameter
        Parameters:
        item - Item to find
        itemsetIndex - Index of the first itemset where we will start to search
        itemIndex - Index of the first item where we will start to search
        Returns:
        the pair position if the item is found, otherwise null value
      • searchForItemInAConcreteTemporalDistance

        public int[] searchForItemInAConcreteTemporalDistance(Item item,
                                                              int itemsetIndex,
                                                              int itemIndex,
                                                              long temporalDistance)
        It returns a pair indicanting the first appearance of an item in the sequence that appears in a itemset that has a temporal distance with respect to the current itemset, as it the given parameter. The starting point where the method takes the search up is given as parameter.
        Parameters:
        item - Item to find
        itemsetIndex - Index of the first itemset where we will start to search
        itemIndex - Index of the first item where we will start to search
        temporalDistance - Temporal distance at which the item to find should be
        Returns:
        the pair position if the item is found, otherwise null value
      • numberOfItemsAfterPositionIth

        public int numberOfItemsAfterPositionIth(int itemsetIndex,
                                                 int itemIndex)
        It gives the number of items that appears after a concrete position of the sequence
        Parameters:
        itemsetIndex - the itemset index in which we will start to look for
        itemIndex - the item index in which we will start to look for
        Returns:
        the number of items

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.