Package implementation.algorithms
Class Partition
- java.lang.Object
-
- implementation.algorithms.Partition
-
- Direct Known Subclasses:
ObservablePartition
public class Partition extends java.lang.Object
Class for the first algorithm described in the article- Author:
- nk-fouque
-
-
Constructor Summary
Constructors Constructor Description Partition(CollectionsModel colMd, java.lang.String uriTarget, int descriptionDepth)
-
Method Summary
Modifier and Type Method Description int
completePartitioning(java.util.concurrent.atomic.AtomicBoolean cut)
Applies the Partition algorithm to the endvoid
cut()
java.util.List<Cluster>
getClusters()
CollectionsModel
getGraph()
The RDF model used by this partitionjava.util.List<Cluster>
getNeighbors()
boolean
oneStepPartitioning()
Applies one iteration of the Partition algorithmjava.lang.String
toString()
-
-
-
Constructor Detail
-
Partition
public Partition(CollectionsModel colMd, java.lang.String uriTarget, int descriptionDepth)
- Parameters:
colMd
- A preexisting CollectionsModel in which to describe the node and search for its neighborsuriTarget
- The full length uri of the node to describedescriptionDepth
- The depth of initial node description (the maximum distance a node can be to the initial node to describe it)
-
-
Method Detail
-
getClusters
public java.util.List<Cluster> getClusters()
- Returns:
- A list containing all the clusters that are still partitionable Should always be empty at the end of the algorithm
-
getNeighbors
public java.util.List<Cluster> getNeighbors()
- Returns:
- A list containing all the neighbors concepts, cluster that have been fully partitioned
-
getGraph
public CollectionsModel getGraph()
The RDF model used by this partition- See Also:
CollectionsModel
-
oneStepPartitioning
public boolean oneStepPartitioning() throws PartitionException, java.lang.OutOfMemoryError
Applies one iteration of the Partition algorithm- Returns:
- false if the partitioning is over, true if it can still be iterated
- Throws:
PartitionException
java.lang.OutOfMemoryError
-
completePartitioning
public int completePartitioning(java.util.concurrent.atomic.AtomicBoolean cut)
Applies the Partition algorithm to the end- Parameters:
cut
- AtomicBoolean to observe, when it is set to false, the algorithm stops and cuts- Returns:
- 0 if the algorithm went to the end correctly, 1 if the algorithm encountered a memory limit, -1 if it encountered an unexpected error
-
cut
public void cut()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-