|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectwpi.associations.arminer.ARMinerItemset
ARMinerItemset.java
An itemset is an ordered list of integers that identify items coupled with a float value representing the support of the itemset as a percentage.
Field Summary | |
private int |
capacity
The capacity of the itemset. |
private int |
index
Internal index used for cycling through the itemset's items. |
private boolean |
mark
The mark of the itemset. |
private int[] |
set
The itemset. |
private int |
size
The number of items in the itemset. |
private static int |
SIZE_INCR
|
private int |
sum
|
private float |
support
The support of the itemset. |
private long |
weight
The weight of the itemset. |
Constructor Summary | |
ARMinerItemset()
Creates a new empty itemset. |
|
ARMinerItemset(ARMinerItemset itemset)
Create a new itemset by copying a given one. |
|
ARMinerItemset(int c)
Create a new empty itemset of specified capacity. |
Method Summary | |
ARMinerItemset |
add(ARMinerItemset itemset)
Return a new ARMinerItemset that contains all those items that appear in this ARMinerItemset and in itemset . |
boolean |
addItem(int item)
Add a new item to the itemset. |
boolean |
canCombineWith(ARMinerItemset itemset)
Check whether two itemsets can be combined. |
ARMinerItemset |
combineWith(ARMinerItemset itemset)
Combine two itemsets into a new one that will contain all the items in the first itemset plus the last item in the second itemset. |
boolean |
doesIntersect(ARMinerItemset itemset)
Return true if this itemset has items in common with itemset . |
int |
getFirstItem()
Return first item in set. |
int |
getItem(int i)
Return i-th item in set. |
int |
getNextItem()
Return next item in set. |
float |
getSupport()
Return support of itemset. |
long |
getWeight()
Return weight of itemset. |
boolean |
hasAttributes(java.util.Vector attributes)
Return true if this itemset has the set of attributes with itemset . |
boolean |
hasMoreItems()
Return true if there are more items in the itemset. |
void |
incrementWeight()
Increment the weight of the itemset. |
boolean |
isEqualTo(ARMinerItemset itemset)
Checks equality with a given itemset. |
boolean |
isIncludedIn(ARMinerItemset itemset)
Checks inclusion in a given itemset. |
boolean |
isMarked()
Return itemset mark. |
static void |
main(java.lang.String[] args)
for testing purposes only !!! |
boolean |
mark()
Mark the itemset. |
static void |
pruneDuplicates(java.util.Vector v)
Remove all duplicate itemsets from the vector v |
static void |
pruneNonMaximal(java.util.Vector v)
Remove all non-maximal itemsets from the vector v |
boolean |
removeItem(int item)
Removes a given item from the itemset. |
boolean |
removeLastItem()
Removes last item (which has the greatest value) from the itemset. |
void |
setSupport(float newSupport)
Set the support of the itemset. |
void |
setWeight(long newWeight)
Set the weight of the itemset. |
int |
size()
Return size of itemset. |
ARMinerItemset |
subtract(ARMinerItemset itemset)
Return a new ARMinerItemset that contains only those items that do not appear in itemset . |
int |
sum()
Gets the sum of the items in the itemset |
java.lang.String |
toString()
Return a String representation of the ARMinerItemset. |
boolean |
unmark()
Unmark the itemset. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private static final int SIZE_INCR
private int capacity
private int size
private int[] set
private float support
private long weight
private boolean mark
private int index
private int sum
Constructor Detail |
public ARMinerItemset()
public ARMinerItemset(int c)
c
- the capacity of the itemset
java.lang.IllegalArgumentException
- c
is negative or zeropublic ARMinerItemset(ARMinerItemset itemset)
itemset
- the itemset to be copied
java.lang.IllegalArgumentException
- itemset
is nullMethod Detail |
public float getSupport()
public long getWeight()
public int getItem(int i)
i
- the index of the item to get
i
-th item
java.lang.IndexOutOfBoundsException
- i
is an invalid indexpublic int getFirstItem()
java.lang.IndexOutOfBoundsException
- there is no first itempublic int getNextItem()
java.lang.IndexOutOfBoundsException
- there is no next itempublic boolean hasMoreItems()
public int size()
public boolean hasAttributes(java.util.Vector attributes)
itemset
.
itemset
contains items of this
itemset, false otherwise.
java.lang.IllegalArgumentException
- itemset
is nullpublic boolean doesIntersect(ARMinerItemset itemset)
itemset
.
itemset
- the itemset with which we compare
itemset
contains items of this
itemset, false otherwise.
java.lang.IllegalArgumentException
- itemset
is nullpublic ARMinerItemset subtract(ARMinerItemset itemset)
itemset
.
itemset
- the itemset whose items we want to subtract
itemset
.
java.lang.IllegalArgumentException
- itemset
is nullpublic ARMinerItemset add(ARMinerItemset itemset)
itemset
.
itemset
- the itemset whose items we want to add
itemset
.
java.lang.IllegalArgumentException
- itemset
is nullpublic boolean addItem(int item)
item
- the item to be added
java.lang.IllegalArgumentException
- item
is <= 0public boolean removeItem(int item)
item
- the item to remove
java.lang.IllegalArgumentException
- item
is <= 0public boolean removeLastItem()
public void setSupport(float newSupport)
newSupport
- the support of the itemset
java.lang.IllegalArgumentException
- newSupport
is < 0
or > 100public void setWeight(long newWeight)
newWeight
- the weight of the itemset
java.lang.IllegalArgumentException
- newWeight
is < 0public void incrementWeight()
public boolean isEqualTo(ARMinerItemset itemset)
itemset
- the itemset against which we test for equality
java.lang.IllegalArgumentException
- itemset
is nullpublic boolean isIncludedIn(ARMinerItemset itemset)
itemset
- the itemset against which we test for inclusion
java.lang.IllegalArgumentException
- itemset
is nullpublic boolean mark()
public boolean unmark()
public boolean isMarked()
public java.lang.String toString()
public boolean canCombineWith(ARMinerItemset itemset)
itemset
- itemset with which to combine
java.lang.IllegalArgumentException
- itemset
is nullpublic ARMinerItemset combineWith(ARMinerItemset itemset)
itemset
- itemset with which to combine
java.lang.IllegalArgumentException
- itemset
is nullpublic int sum()
public static void pruneNonMaximal(java.util.Vector v)
v
- the collection of itemsetspublic static void pruneDuplicates(java.util.Vector v)
v
- the collection of itemsetspublic static void main(java.lang.String[] args)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |