|
jInfer | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object cz.cuni.mff.ksi.jinfer.twostep.clustering.withattributesiname.AttributeClusterer
public class AttributeClusterer
Helper class for Iname
. Clusters attributes for one
element, by name (case insensitive).
Constructor Summary | |
---|---|
AttributeClusterer()
Default constructor. |
Method Summary | |
---|---|
void |
add(Attribute item)
Add x to some clusterer, enqueue for processing. |
void |
addAll(Collection<Attribute> items)
Add the whole collection to queue for clustering |
void |
cluster()
Do the main job, cluster enqueued items into clusters. |
List<Cluster<Attribute>> |
getClusters()
Without doing clustering again, return result of last cluster() call. |
Attribute |
getRepresentantForItem(Attribute item)
Return representative of the item's cluster |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AttributeClusterer()
Method Detail |
---|
public void add(Attribute item)
Clusterer
add
in interface Clusterer<Attribute>
item
- to addpublic void addAll(Collection<Attribute> items)
Clusterer
addAll
in interface Clusterer<Attribute>
items
- elements to addpublic void cluster() throws InterruptedException
Clusterer
Example: add(x), add(y), add(xx), add(yx), enqueued items: x, y, xx, yx. Calling cluster() creates clusters for example based on starting letter. Creates two clusters: (x, xx) | (y, yx)
Now let user use add(xd), add(zz). Calling cluster() again have to result in (x, xx, xd) | (y, yx) | (zz)
Of course, if cluster criterion is not so stable as first letter, items x, xx, y, yx
can change their clusters and so. Point is, that they don't disappear. Once an item is added
clusterer has to hold it for future cluster() calls.
cluster method has to check for interruption of thread by using:
if (Thread.interrupted()) {
throw new InterruptedException();
}
in some main loop.
cluster
in interface Clusterer<Attribute>
InterruptedException
public Attribute getRepresentantForItem(Attribute item)
Clusterer
getRepresentantForItem
in interface Clusterer<Attribute>
public List<Cluster<Attribute>> getClusters()
Clusterer
getClusters
in interface Clusterer<Attribute>
cluster
|
jInfer | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |