|
jInfer | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcz.cuni.mff.ksi.jinfer.twostep.clustering.withattributesiname.Iname
public class Iname
Cluster nodes by name - ignoring case. Clustering is done by iterating queued items for clustering, for each item, iterate clusters. If any representant is of same type (SimpleData, Element,Attribute) add item to cluster. If cluster is not found, create new with item as representant. For SimpleData, check for same name is omitted, all simpledata ends up in one cluster for each element.
| Constructor Summary | |
|---|---|
Iname()
Default constructor. |
|
| Method Summary | |
|---|---|
void |
add(AbstractStructuralNode item)
Add x to some clusterer, enqueue for processing. |
void |
addAll(Collection<AbstractStructuralNode> items)
Add the whole collection to queue for clustering |
void |
cluster()
Do the main job, cluster enqueued items into clusters. |
List<Cluster<Attribute>> |
getAttributeClusters(AbstractStructuralNode representant)
Returns all clusters of attributes for a given representative of cluster (for a given element cluster de facto). |
List<Cluster<AbstractStructuralNode>> |
getClusters()
Without doing clustering again, return result of last cluster() call. |
AbstractStructuralNode |
getRepresentantForItem(AbstractStructuralNode 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 Iname()
| Method Detail |
|---|
public void add(AbstractStructuralNode item)
Clusterer
add in interface Clusterer<AbstractStructuralNode>item - to addpublic void addAll(Collection<AbstractStructuralNode> items)
Clusterer
addAll in interface Clusterer<AbstractStructuralNode>items - elements to add
public void cluster()
throws InterruptedException
ClustererExample: 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<AbstractStructuralNode>InterruptedExceptionpublic AbstractStructuralNode getRepresentantForItem(AbstractStructuralNode item)
Clusterer
getRepresentantForItem in interface Clusterer<AbstractStructuralNode>public List<Cluster<AbstractStructuralNode>> getClusters()
Clusterer
getClusters in interface Clusterer<AbstractStructuralNode>clusterpublic List<Cluster<Attribute>> getAttributeClusters(AbstractStructuralNode representant)
ClustererWithAttributes
getAttributeClusters in interface ClustererWithAttributes<AbstractStructuralNode,Attribute>
|
jInfer | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||