Class Itemset


  • public class Itemset
    extends java.lang.Object
    This class represents an itemset from a sequence where the itemset is a list of strings ordered by lexical order and does not contain an item twice, and the support of the itemset is not stored.
    Author:
    Philippe Fournier-Viger
    See Also:
    AbstractOrderedItemsetsAdapter
    • Constructor Summary

      Constructors 
      Constructor Description
      Itemset()
      Constructor to create an empty itemset.
      Itemset​(java.lang.Integer item)
      Constructor to create an itemset with an item
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addItem​(java.lang.Integer value)
      Add an item to this itemset
      Itemset cloneItemSet()
      This method makes a copy of an itemset
      Itemset cloneItemSetMinusItems​(java.util.Map<java.lang.Integer,​java.util.Set<java.lang.Integer>> mapSequenceID, double relativeMinsup)
      This methods makes a copy of this itemset but without items having a support lower than minsup
      boolean containsAll​(Itemset itemset2)
      This methods checks if another itemset is contained in this one.
      java.lang.Integer get​(int index)
      Get an item at a given position in this itemset
      java.util.List<java.lang.Integer> getItems()
      Get the list of items
      int size()
      Get the size of this itemset (the number of items)
      java.lang.String toString()
      Get this itemset as a string
      • Methods inherited from class java.lang.Object

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

      • Itemset

        public Itemset​(java.lang.Integer item)
        Constructor to create an itemset with an item
        Parameters:
        item - the item
      • Itemset

        public Itemset()
        Constructor to create an empty itemset.
    • Method Detail

      • addItem

        public void addItem​(java.lang.Integer value)
        Add an item to this itemset
        Parameters:
        value - the item
      • getItems

        public java.util.List<java.lang.Integer> getItems()
        Get the list of items
        Returns:
        list of items
      • get

        public java.lang.Integer get​(int index)
        Get an item at a given position in this itemset
        Parameters:
        index - the position
        Returns:
        the item
      • toString

        public java.lang.String toString()
        Get this itemset as a string
        Overrides:
        toString in class java.lang.Object
        Returns:
        this itemset as a string
      • size

        public int size()
        Get the size of this itemset (the number of items)
        Returns:
        the size
      • cloneItemSetMinusItems

        public Itemset cloneItemSetMinusItems​(java.util.Map<java.lang.Integer,​java.util.Set<java.lang.Integer>> mapSequenceID,
                                              double relativeMinsup)
        This methods makes a copy of this itemset but without items having a support lower than minsup
        Parameters:
        mapSequenceID - a map indicating the support of each item. key: item value: support
        relativeMinsup - the support expressed as a percentage
        Returns:
        the new itemset
      • cloneItemSet

        public Itemset cloneItemSet()
        This method makes a copy of an itemset
        Returns:
        the copy.
      • containsAll

        public boolean containsAll​(Itemset itemset2)
        This methods checks if another itemset is contained in this one.
        Parameters:
        itemset2 - the other itemset
        Returns:
        true if it is contained