wpi.associations.arminerSequence
Class DBCacheReader

java.lang.Object
  extended bywpi.associations.arminerSequence.DBCacheReader

public class DBCacheReader
extends java.lang.Object

DBCacheReader.java A DBCacheReader deserializes itemsets from cache.

Author:
Dana Cristofor, Laurentiu Cristofor, Keith A. Pray (kap@wpi.edu)

Field Summary
private  java.lang.String filename
           
private  java.io.ObjectInputStream instream
           
 
Constructor Summary
DBCacheReader(java.lang.String name)
          Initializes a DBCacheReader to read from the specified cache file.
 
Method Summary
 void close()
          Closes the cache file.
 java.util.Vector compare(DBCacheReader dbCacheReader)
          Returns the itemsets contained in this cache that do not appear in the specified db cache reader.
 ARMinerItemset getFirstItemset()
          Return the first itemset from cache.
 ARMinerItemset getNextItemset()
          Return next itemset from cache.
static void main(java.lang.String[] args)
          For testing.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

instream

private java.io.ObjectInputStream instream

filename

private java.lang.String filename
Constructor Detail

DBCacheReader

public DBCacheReader(java.lang.String name)
              throws java.io.IOException
Initializes a DBCacheReader to read from the specified cache file.

Parameters:
name - name of the cache file
Throws:
java.lang.IllegalArgumentException - name is null
java.io.IOException - from java.io package
Method Detail

close

public void close()
           throws java.io.IOException
Closes the cache file.

Throws:
java.io.IOException - from java.io package

getFirstItemset

public ARMinerItemset getFirstItemset()
                               throws java.io.IOException,
                                      java.lang.ClassNotFoundException
Return the first itemset from cache.

Returns:
first itemset in cache
Throws:
java.io.IOException - from java.io package
java.lang.ClassNotFoundException - from java.io package

getNextItemset

public ARMinerItemset getNextItemset()
                              throws java.io.IOException,
                                     java.lang.ClassNotFoundException
Return next itemset from cache.

Returns:
next itemset in cache
Throws:
java.io.IOException - from java.io package
java.lang.ClassNotFoundException - from java.io package

compare

public java.util.Vector compare(DBCacheReader dbCacheReader)
                         throws java.io.IOException,
                                java.lang.ClassNotFoundException
Returns the itemsets contained in this cache that do not appear in the specified db cache reader.

Parameters:
dbCacheReader - the cache to compare to
Throws:
java.io.IOException
java.lang.ClassNotFoundException

main

public static void main(java.lang.String[] args)
For testing. Also contains a utility for comparing two cache files. The itemsets from the first cache (-t) file not found in the second (-c) are displayed.