Class Itemset


  • public final class Itemset
    extends java.lang.Object
    This class represents an itemset from a sequence. The itemset consists of a list of items and an timestamp that denotes when the itemset occurs. An itemset with timestamp is also called "transaction" 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 .
    Author:
    agomariz
    • Constructor Summary

      Constructors 
      Constructor Description
      Itemset()
      Standard Itemset constructor
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addItem​(Item value)
      It adds an item to the itemset.
      Itemset cloneItemSet()
      It clones the itemset.
      Item get​(int index)
      It returns the item from the specified position.
      java.util.List<Item> getItems()
      It returns the list of items that compose the itemset.
      long getTimestamp()  
      Item removeItem​(int i)
      It removes the item which appears in the specified index.
      void setTimestamp​(long timestamp)  
      int size()
      It returns the number of items that compose the itemset.
      java.lang.String toString()
      Get the string representation of this itemset.
      • Methods inherited from class java.lang.Object

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

      • Itemset

        public Itemset()
        Standard Itemset constructor
    • Method Detail

      • addItem

        public void addItem​(Item value)
        It adds an item to the itemset. The item is inserted in the last position.
        Parameters:
        value - The item to add
      • removeItem

        public Item removeItem​(int i)
        It removes the item which appears in the specified index.
        Parameters:
        i - the index
        Returns:
        the removed item
      • getItems

        public java.util.List<Item> getItems()
        It returns the list of items that compose the itemset.
        Returns:
        the list of items
      • get

        public Item get​(int index)
        It returns the item from the specified position.
        Parameters:
        index - The index where is the item in which we are interested.
        Returns:
        the item
      • toString

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

        public Itemset cloneItemSet()
        It clones the itemset.
        Returns:
        The clone itemset.
      • getTimestamp

        public long getTimestamp()
      • setTimestamp

        public void setTimestamp​(long timestamp)
      • size

        public int size()
        It returns the number of items that compose the itemset.
        Returns:
        the number of items