modelling.fiti.data
Class Transaction

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

public class Transaction
extends java.lang.Object

Class implementing a transaction. A transaction is a set of items occurring togehter at a specific time. Mega transactions have timestamp = -1.

Author:
Kjell-Inge Skogstad and Trond Řivind Eriksen

Constructor Summary
Transaction()
          Constructor creating a new transaction.
Transaction(int timestamp)
          Constructor creating a new transaction.
 
Method Summary
 void addItem(java.lang.Object item)
          Method for adding an item to the transaction if it is not already present.
 boolean contains(ItemSet itemset)
          Method for finding if the transaction contains a specific itemset, i.e.
 java.util.ArrayList getItems()
          Method for getting the items in the transaction.
 int getTimestamp()
          Method for getting the timestamp of the transaction.
 java.lang.String toString()
          Method for getting a printable representation of the transaction.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Transaction

public Transaction(int timestamp)
Constructor creating a new transaction.

Parameters:
timestamp - The timestamp

Transaction

public Transaction()
Constructor creating a new transaction. Timestamp is set to -1.

Method Detail

addItem

public void addItem(java.lang.Object item)
Method for adding an item to the transaction if it is not already present.

Parameters:
item - The item

getItems

public java.util.ArrayList getItems()
Method for getting the items in the transaction.

Returns:
List of items

contains

public boolean contains(ItemSet itemset)
Method for finding if the transaction contains a specific itemset, i.e. all items in the itemset.

Parameters:
itemset - The itemset
Returns:
True if itemset is contained in the transaction

getTimestamp

public int getTimestamp()
Method for getting the timestamp of the transaction.

Returns:
The timestamp

toString

public java.lang.String toString()
Method for getting a printable representation of the transaction.

Overrides:
toString in class java.lang.Object