|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--laur.dm.ar.Itemset
An itemset is an ordered list of integers that identify items coupled with a double value representing the support of the itemset as a percentage.
Field Summary | |
static int |
BY_SIZE
Specifies sorting should be performed according to itemset size. |
static int |
BY_SUPPORT
Specifies sorting should be performed according to itemset support. |
Constructor Summary | |
Itemset()
Creates a new empty itemset. |
|
Itemset(int c)
Create a new empty itemset of specified capacity. |
|
Itemset(Itemset itemset)
Create a new itemset by copying a given one. |
Method Summary | |
boolean |
add(int item)
Add a new item to the itemset. |
boolean |
canCombineWith(Itemset itemset)
Check whether two itemsets can be combined. |
Itemset |
combineWith(Itemset 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. |
int |
compareTo(java.lang.Object obj,
int criteria)
Compare two Itemset objects on one of several criteria. |
boolean |
equals(java.lang.Object o)
Checks equality with another object. |
int |
get(int i)
Return i-th item in itemset. |
double |
getSupport()
Return support of itemset. |
long |
getWeight()
Return weight of itemset. |
void |
incrementWeight()
Increment the weight of the itemset. |
boolean |
intersects(Itemset itemset)
Return true if this itemset has items in common with itemset . |
boolean |
isIncludedIn(Itemset itemset)
Checks inclusion in a given itemset. |
boolean |
isMarked()
Return itemset mark. |
static void |
main(java.lang.String[] args)
sample usage and testing |
boolean |
mark()
Mark the itemset. |
static void |
pruneDuplicates(java.util.ArrayList v)
Remove all duplicate itemsets from the vector v |
static void |
pruneNonMaximal(java.util.ArrayList v)
Remove all non-maximal itemsets from the vector v |
boolean |
remove(int item)
Removes a given item from the itemset. |
boolean |
removeLast()
Removes last item (which has the greatest value) from the itemset. |
void |
setSupport(double newSupport)
Set the support of the itemset. |
void |
setWeight(long newWeight)
Set the weight of the itemset. |
int |
size()
Return size of itemset. |
static Itemset |
subtraction(Itemset is1,
Itemset is2)
Return a new Itemset that contains only those items from is1 that do not appear in is2 . |
java.lang.String |
toString()
Return a String representation of the Itemset. |
static Itemset |
union(Itemset is1,
Itemset is2)
Return a new Itemset that contains all those items that appear in is1 and in is2 . |
boolean |
unmark()
Unmark the itemset. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int BY_SIZE
public static final int BY_SUPPORT
Constructor Detail |
public Itemset(int c)
c
- the capacity of the itemsetjava.lang.IllegalArgumentException
- c
is negative or zeropublic Itemset()
public Itemset(Itemset itemset)
itemset
- the itemset to be copiedjava.lang.IllegalArgumentException
- itemset
is nullMethod Detail |
public double getSupport()
public void setSupport(double newSupport)
newSupport
- the support of the itemsetjava.lang.IllegalArgumentException
- newSupport
is < 0
or > 100public long getWeight()
public void setWeight(long newWeight)
newWeight
- the weight of the itemsetjava.lang.IllegalArgumentException
- newWeight
is < 0public void incrementWeight()
public int size()
public int get(int i)
i
- the index of the item to geti
-th itemIndexOutOfBoundsException
- i
is an invalid indexpublic boolean add(int item)
item
- the item to be addedjava.lang.IllegalArgumentException
- item
is <= 0public boolean remove(int item)
item
- the item to removejava.lang.IllegalArgumentException
- item
is <= 0public boolean removeLast()
public int compareTo(java.lang.Object obj, int criteria)
compareTo
in interface CriteriaComparable
is
- the Itemset object with which we want to compare this
objectcriteria
- the criteria on which we want to compare, can
be one of SIZE or SUPPORT.is
, 0 if they are equal, and a positive value if this
object is greater.java.lang.IllegalArgumentException
- obj
is not
an Itemset or criteria is invalidpublic boolean equals(java.lang.Object o)
equals
in class java.lang.Object
o
- the object against which we test for equalitypublic boolean isIncludedIn(Itemset itemset)
itemset
- the itemset against which we test for inclusionjava.lang.IllegalArgumentException
- itemset
is nullpublic boolean intersects(Itemset itemset)
itemset
.itemset
- the itemset with which we compareitemset
contains items of this
itemset, false otherwise.java.lang.IllegalArgumentException
- itemset
is nullpublic static Itemset subtraction(Itemset is1, Itemset is2)
is1
that do not appear in is2
.is1
- the itemset from which we want to subtractis2
- the itemset whose items we want to subtractis1
that do not appear in is2
.java.lang.IllegalArgumentException
- is1
or
is2
is nullpublic static Itemset union(Itemset is1, Itemset is2)
is1
and in is2
.is1
- the first itemset participating to the unionis2
- the second itemset participating to the unionis1
and in is2
.java.lang.IllegalArgumentException
- is1
or
is2
is nullpublic boolean canCombineWith(Itemset itemset)
itemset
- itemset with which to combinejava.lang.IllegalArgumentException
- itemset
is nullpublic Itemset combineWith(Itemset itemset)
itemset
- itemset with which to combinejava.lang.IllegalArgumentException
- itemset
is nullpublic boolean mark()
public boolean unmark()
public boolean isMarked()
public java.lang.String toString()
toString
in class java.lang.Object
public static void pruneNonMaximal(java.util.ArrayList v)
v
- the collection of itemsetspublic static void pruneDuplicates(java.util.ArrayList v)
v
- the collection of itemsetspublic static void main(java.lang.String[] args)
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |