Class Itemset


  • public class Itemset
    extends AbstractOrderedItemset
    This class represents an itemset (a set of items) implemented as an array of integers with a variable to store the support count of the itemset.
    Author:
    Philippe Fournier-Viger
    • Field Detail

      • itemset

        public int[] itemset
        the array of items
      • support

        public int support
        the support of this itemset
      • traceList

        public java.util.List<java.lang.Integer> traceList
        List of traces with this Itemset
    • Constructor Detail

      • Itemset

        public Itemset()
        Constructor
      • Itemset

        public Itemset​(int item)
        Constructor
        Parameters:
        item - an item that should be added to the new itemset
      • Itemset

        public Itemset​(int[] items)
        Constructor
        Parameters:
        items - an array of items that should be added to the new itemset
      • Itemset

        public Itemset​(java.util.List<java.lang.Integer> itemset,
                       int support,
                       java.util.List<java.lang.Integer> tracelist)
        Constructor
        Parameters:
        items - a list of Integer representing items in the itemset
        support - the support of the itemset
    • Method Detail

      • getItems

        public int[] getItems()
        Get the items as array
        Returns:
        the items
      • getTraceList

        public java.util.List<java.lang.Integer> getTraceList()
      • size

        public int size()
        Get the size of this itemset
        Specified by:
        size in class AbstractOrderedItemset
        Returns:
        the size of this itemset
      • get

        public java.lang.Integer get​(int position)
        Get the item at a given position in this itemset
        Specified by:
        get in class AbstractOrderedItemset
        Parameters:
        position - the position of the item to be returned
        Returns:
        the item
      • setAbsoluteSupport

        public void setAbsoluteSupport​(java.lang.Integer support)
        Set the support of this itemset
        Parameters:
        support - the support
      • increaseTransactionCount

        public void increaseTransactionCount()
        Increase the support of this itemset by 1
      • setTraceList

        public void setTraceList​(java.util.List<java.lang.Integer> traces)
      • addTrace

        public void addTrace​(int i)
      • cloneItemSetMinusOneItem

        public Itemset cloneItemSetMinusOneItem​(java.lang.Integer itemToRemove)
        Make a copy of this itemset but exclude a given item
        Parameters:
        itemToRemove - the given item
        Returns:
        the copy
      • cloneItemSetMinusAnItemset

        public Itemset cloneItemSetMinusAnItemset​(Itemset itemsetToNotKeep)
        Make a copy of this itemset but exclude a set of items
        Parameters:
        itemsetToNotKeep - the set of items to be excluded
        Returns:
        the copy
      • intersection

        public Itemset intersection​(Itemset itemset2)
        This method return an itemset containing items that are included in this itemset and in a given itemset
        Parameters:
        itemset2 - the given itemset
        Returns:
        the new itemset
      • hashCode

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