Documentation of 'ca.pfv.spmf.algorithms.sequentialpatterns.spade_spam_AGP.dataStructures.patterns.Pattern' Java class
Pattern
ca.pfv.spmf.algorithms.sequentialpatterns.spade_spam_AGP.dataStructures.patterns

Class Pattern

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


    public class Pattern
    extends java.lang.Object
    implements java.lang.Comparable<Pattern>
    Implementation of pattern structure. We define it as a list of pairs . Besides, a bitSet appearingIn denotes the sequences where the pattern appears. 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 Detail

      • Pattern

        public Pattern()
        Standard constructor
      • Pattern

        public Pattern(java.util.List<ItemAbstractionPair> elements)
        New pattern from a list of pairs
        Parameters:
        elements -
      • Pattern

        public Pattern(ItemAbstractionPair pair)
        New pattern from a single pair
        Parameters:
        pair -
    • Method Detail

      • toString

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

        public java.lang.String toStringToFile()
        Get the string representation of this itemset adjusted to SPMF format.
        Returns:
        the string representation.
      • clonePattern

        public Pattern clonePattern()
        It clones a pattern
        Returns:
        the resulting pattern
      • getElements

        public java.util.List<ItemAbstractionPair> getElements()
        It obtains the elements of the pattern
        Returns:
        the list of elements in this pattern.
      • getIthElement

        public ItemAbstractionPair getIthElement(int i)
        It obtains the Ith element of the pattern
        Parameters:
        i - the ith element
        Returns:
        the element
      • getLastButOneElement

        public ItemAbstractionPair getLastButOneElement()
        It obtains the last but one element of the pattern
        Returns:
        the last but one element
      • getLastElement

        public ItemAbstractionPair getLastElement()
        It obtains the last element of the pattern
        Returns:
        the last element
      • setElements

        public void setElements(java.util.List<ItemAbstractionPair> elements)
        Setter method to set the elements of the pattern
        Parameters:
        elements -
      • add

        public void add(ItemAbstractionPair pair)
        It adds an item with its abstraction in the pattern. The new pair is added in the last position of the pattern.
        Parameters:
        pair -
      • size

        public int size()
        It returns the number of items contained in the pattern
        Returns:
        the number of items
      • compareTo

        public int compareTo(Pattern arg)
        Compare this pattern with another Since we always compare elements which belong to the same equivalence class we only make the comparison of the last items of both patterns.
        Specified by:
        compareTo in interface java.lang.Comparable<Pattern>
        Parameters:
        arg - another pattern
        Returns:
        0 if equals, -1 if this one is smaller, otherwise 1
      • equals

        public boolean equals(java.lang.Object arg)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • isPrefix

        public boolean isPrefix(Pattern p)
        It informs us if this pattern is a prefix of the argument given pattern.
        Parameters:
        p - the pattern
        Returns:
        true if the pattern is a prefix, otherwise false.
      • getAppearingIn

        public java.util.BitSet getAppearingIn()
        It returns the list of sequence IDs where the pattern appears.
        Returns:
        the list of sequence IDs
      • setAppearingIn

        public void setAppearingIn(java.util.BitSet appearingIn)
        it set the list of sequence IDs where the pattern appears.
        Parameters:
        appearingIn -
      • clear

        public void clear()

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.