modelling.fiti.data
Class ItemSet

java.lang.Object
  extended by modelling.fiti.data.ItemSet

public class ItemSet
extends java.lang.Object

Class implementing an itemset. An itemset includes a list of items, either intra or inter, and associated count and support.

Author:
Kjell-Inge Skogstad and Trond Řivind Eriksen

Constructor Summary
ItemSet()
          Constructor creating a new itemset.
 
Method Summary
 void addItem(Item item)
          Method for adding an item.
 void addOne()
          Method for updating count on itemset. count++;
 ItemSet clone()
          Method for getting a clone of this instance.
 boolean containsItem(Item item)
          Method for testin if the itemset contains a given item.
 boolean equals(java.lang.Object o)
          Method for comapring two itemsets.
 int getCount()
          Method for getting count.
 Item getItem(int index)
          Method for getting an item.
 int getItemListIndex(int i)
          Method for getting the itemlist index of item given its index in the itemset.
 java.util.ArrayList getItems()
          Method for getting all items.
 double getSupport()
          Method for getting the support.
 void removeItem(int index)
          Method for removing an item.
 void setSupport(double support)
          Method for setting the support.
 int size()
          Method for getting the number of items.
 java.lang.String toString()
          Method for getting a printable representation of this itemset.
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ItemSet

public ItemSet()
Constructor creating a new itemset. Count and support are set to 0.

Method Detail

addItem

public void addItem(Item item)
Method for adding an item. Item is stored as an itemlist index.

Parameters:
item - The item

getItemListIndex

public int getItemListIndex(int i)
Method for getting the itemlist index of item given its index in the itemset.

Parameters:
i - The itemset index
Returns:
The itemlist index

removeItem

public void removeItem(int index)
Method for removing an item.

Parameters:
index - The index

getItem

public Item getItem(int index)
Method for getting an item.

Parameters:
index - The index
Returns:
The item

getItems

public java.util.ArrayList getItems()
Method for getting all items.

Returns:
List of items

size

public int size()
Method for getting the number of items.

Returns:
Number of items

containsItem

public boolean containsItem(Item item)
Method for testin if the itemset contains a given item.

Parameters:
item - The item
Returns:
True if item is contained in itemset

equals

public boolean equals(java.lang.Object o)
Method for comapring two itemsets.

Overrides:
equals in class java.lang.Object

addOne

public void addOne()
Method for updating count on itemset. count++;


getCount

public int getCount()
Method for getting count.

Returns:
The count

setSupport

public void setSupport(double support)
Method for setting the support.

Parameters:
support - The support

getSupport

public double getSupport()
Method for getting the support.

Returns:
The support

clone

public ItemSet clone()
Method for getting a clone of this instance.

Overrides:
clone in class java.lang.Object

toString

public java.lang.String toString()
Method for getting a printable representation of this itemset.

Overrides:
toString in class java.lang.Object