|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.ksu.cis.kdd.data.TableTally
Tallying tuples. Contains cache. So, if you modify the tuples, it won't reflect the changes. You will have to reset the cache manually. OR you can always create a new Tally object.
Field Summary | |
protected Attribute[] |
attrs
|
protected java.util.HashSet |
continuousValues
|
protected java.util.Set |
indexableAttr
|
protected java.util.Hashtable |
indexCache
|
protected java.util.Set[] |
indexedValues
|
protected int[] |
local2globalIndex
|
protected boolean |
needIndexing
|
protected DatabaseTally |
owner
|
protected Table |
table
|
protected int |
tallyID
|
protected int |
tupleCount
|
protected java.util.Hashtable |
valueCache
|
Method Summary | |
Tally |
createSubTally(int[] indices,
int[] values)
Create a new tally that basically filtered according to the spec mentioned in the q table (i.e. the query table). |
Tally |
createSubTally(int idx,
int value)
Create subtally that has val[nodeindex] = value. |
void |
filter(int idx,
java.util.Set values)
Pretty much like createSubTally, except that it doesn't create a new Tally object and apply the filter to this object. |
int |
getArity(int i)
Get the values of a particular atribute name |
int |
getArity(java.lang.String attr)
Get the values of a particular atribute name |
DatabaseTally |
getOwner()
|
int[] |
getRelevantAttributeIndices()
|
int |
getTallyID()
|
Data |
getUnderlyingData()
|
int |
getValueIndex(java.lang.String attr,
java.lang.String value)
|
java.util.List |
groupedTally(int[] indices)
|
protected java.util.List |
groupedTally(int[] indices,
int[] values,
int depth,
java.util.List valueList)
|
void |
resetCache()
|
void |
setOwner(DatabaseTally tally)
|
void |
setUnderlyingData(Data tuples)
Sets the tuples. |
int |
size()
|
int |
tally(int[] indices,
int[] values)
Count the number of tuples that is compliant to the spec mentioned in the q table (i.e. the query table). |
int |
tally(int idx,
int value)
Count the number of tuples that has val[nodeindex] = value. |
double |
weightedTally()
Count total weights of the tuples |
double |
weightedTally(int idx,
int value)
Count the weights of tuples that has val[nodeindex] = value. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected Table table
protected java.util.Hashtable valueCache
protected java.util.Hashtable indexCache
protected java.util.HashSet continuousValues
protected int tupleCount
protected Attribute[] attrs
protected int tallyID
protected DatabaseTally owner
protected int[] local2globalIndex
protected java.util.Set indexableAttr
protected java.util.Set[] indexedValues
protected boolean needIndexing
Method Detail |
public int getTallyID()
public void resetCache()
public int tally(int[] indices, int[] values)
Count the number of tuples that is compliant to the spec mentioned in the q table (i.e. the query table).
If you only have one entry in q table, better use tally(int, int).
tally
in interface Tally
indices
- is the array of indexvalues
- is the array of values of that index
public int tally(int idx, int value)
tally
in interface Tally
idx
- Node indexvalue
- Node value
public double weightedTally(int idx, int value)
weightedTally
in interface WeightedTally
idx
- Node indexvalue
- Node value
public double weightedTally()
weightedTally
in interface WeightedTally
public Tally createSubTally(int[] indices, int[] values)
Create a new tally that basically filtered according to the spec mentioned in the q table (i.e. the query table).
If you only have one entry in q table, better use createSubTally(int, int).
createSubTally
in interface Tally
indices
- is the array of indexvalues
- is the array of values of that index
public Tally createSubTally(int idx, int value)
Create subtally that has val[nodeindex] = value.
createSubTally
in interface Tally
idx
- Node indexvalue
- Node value
public void filter(int idx, java.util.Set values)
idx
- values
- public int getValueIndex(java.lang.String attr, java.lang.String value)
public int getArity(java.lang.String attr)
attr
-
public int getArity(int i)
public Data getUnderlyingData()
getUnderlyingData
in interface Tally
public void setUnderlyingData(Data tuples)
setUnderlyingData
in interface Tally
tuples
- The tuples to setpublic int size()
size
in interface Tally
public DatabaseTally getOwner()
public void setOwner(DatabaseTally tally)
tally
- public int[] getRelevantAttributeIndices()
getRelevantAttributeIndices
in interface Tally
public java.util.List groupedTally(int[] indices)
groupedTally
in interface Tally
edu.ksu.cis.kdd.data.TallyInterface#groupedTally(int[])
protected java.util.List groupedTally(int[] indices, int[] values, int depth, java.util.List valueList)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |