ca.pfv.spmf.input.transaction_database_list_integers
Class TransactionDatabase
- java.lang.Object
-
- ca.pfv.spmf.input.transaction_database_list_integers.TransactionDatabase
-
public class TransactionDatabase extends java.lang.ObjectThis class represents a transaction database (a.k.a. binary context), implemented as a list of integers. It can read a transaction database directly from a file. See the ca.pfv.spmf.test folder for some examples of files that can be read.
-
-
Constructor Summary
Constructors Constructor and Description TransactionDatabase()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidaddTransaction(java.util.List<java.lang.Integer> transaction)Method to add a new transaction to this database.java.util.Set<java.lang.Integer>getItems()Get the set of items contained in this database.java.util.List<java.util.List<java.lang.Integer>>getTransactions()Get the list of transactions in this databasevoidloadFile(java.lang.String path)Method to load a file containing a transaction database into memoryvoidprintDatabase()Method to print the content of the transaction database to the console.intsize()Get the number of transactions in this transaction database.
-
-
-
Method Detail
-
addTransaction
public void addTransaction(java.util.List<java.lang.Integer> transaction)
Method to add a new transaction to this database.- Parameters:
transaction- the transaction to be added
-
loadFile
public void loadFile(java.lang.String path) throws java.io.IOExceptionMethod to load a file containing a transaction database into memory- Parameters:
path- the path of the file- Throws:
java.io.IOException- exception if error reading the file
-
printDatabase
public void printDatabase()
Method to print the content of the transaction database to the console.
-
size
public int size()
Get the number of transactions in this transaction database.- Returns:
- the number of transactions.
-
getTransactions
public java.util.List<java.util.List<java.lang.Integer>> getTransactions()
Get the list of transactions in this database- Returns:
- A list of transactions (a transaction is a list of Integer).
-
getItems
public java.util.Set<java.lang.Integer> getItems()
Get the set of items contained in this database.- Returns:
- The set of items.
-
-
DMelt 3.0 © DataMelt by jWork.ORG