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 Details

  • Method Details

    • associateFileWithCluster

      public void associateFileWithCluster​(File file, long timestamp, ClusterIdentifier clusterIdentifier) throws org.anchoranalysis.core.exception.OperationFailedException
      Indicates 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

      public ClusterIdentifier clusterFor​(File file)
      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.