Class ClusterMembership
Object
org.anchoranalysis.plugin.io.file.copy.ClusterMembership
public class ClusterMembership extends Object
A mapping of files to membership of particular clusters.
- Author:
- Owen Feehan
-
Constructor Summary
Constructors Constructor Description ClusterMembership(ClusterIdentifier clusterIdentifierIfAbsent) -
Method Summary
Modifier and Type Method Description voidassociateFileWithCluster(File file, long timestamp, ClusterIdentifier clusterIdentifier)Indicates a particular file is a member of a particular cluster.ClusterIdentifierclusterFor(File file)Finds the corresponding cluster for a particular file.
-
Constructor Details
-
Method Details
-
associateFileWithCluster
public void associateFileWithCluster(File file, long timestamp, ClusterIdentifier clusterIdentifier) throws org.anchoranalysis.core.exception.OperationFailedExceptionIndicates a particular file is a member of a particular cluster.- Parameters:
file- the file.timestamp- the timetamp (seconds since the epoch).clusterIdentifier- an identifier for the cluster.- Throws:
org.anchoranalysis.core.exception.OperationFailedException- if the file is already associated with a cluster.
-
clusterFor
Finds the corresponding cluster for a particular file.- Parameters:
file- the file to find a cluster for.- Returns:
- the identifier for the cluster from the map, or
clusterIdentifierIfAbsent(as per constructor) if the file is not mapped.
-