File tree Expand file tree Collapse file tree 1 file changed +56
-0
lines changed
Others/DataMining_MSApriori Expand file tree Collapse file tree 1 file changed +56
-0
lines changed Original file line number Diff line number Diff line change
1
+ package DataMining_MSApriori ;
2
+
3
+ /**
4
+ * 频繁项集
5
+ *
6
+ * @author lyq
7
+ *
8
+ */
9
+ public class FrequentItem implements Comparable <FrequentItem >{
10
+ // 频繁项集的集合ID
11
+ private String [] idArray ;
12
+ // 频繁项集的支持度计数
13
+ private int count ;
14
+ //频繁项集的长度,1项集或是2项集,亦或是3项集
15
+ private int length ;
16
+
17
+ public FrequentItem (String [] idArray , int count ){
18
+ this .idArray = idArray ;
19
+ this .count = count ;
20
+ length = idArray .length ;
21
+ }
22
+
23
+ public String [] getIdArray () {
24
+ return idArray ;
25
+ }
26
+
27
+ public void setIdArray (String [] idArray ) {
28
+ this .idArray = idArray ;
29
+ }
30
+
31
+ public int getCount () {
32
+ return count ;
33
+ }
34
+
35
+ public void setCount (int count ) {
36
+ this .count = count ;
37
+ }
38
+
39
+ public int getLength () {
40
+ return length ;
41
+ }
42
+
43
+ public void setLength (int length ) {
44
+ this .length = length ;
45
+ }
46
+
47
+ @ Override
48
+ public int compareTo (FrequentItem o ) {
49
+ // TODO Auto-generated method stub
50
+ Integer int1 = Integer .parseInt (this .getIdArray ()[0 ]);
51
+ Integer int2 = Integer .parseInt (o .getIdArray ()[0 ]);
52
+
53
+ return int1 .compareTo (int2 );
54
+ }
55
+
56
+ }
You can’t perform that action at this time.
0 commit comments