Class IdentityDocumentalStrategy
- java.lang.Object
-
- it.unimi.di.big.mg4j.index.cluster.IdentityDocumentalStrategy
-
- All Implemented Interfaces:
ClusteringStrategy,DocumentalClusteringStrategy,Serializable
public class IdentityDocumentalStrategy extends Object implements DocumentalClusteringStrategy, Serializable
A documental strategy that maps identically local to global pointers and viceversa.When clustering a posteriori a set of previously built renumbered indices using a
DocumentalMergedCluster, local document pointers are actually global document pointers. In this case, an instance of this class should be used as a strategy for the cluster.- Author:
- Sebastiano Vigna
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description IdentityDocumentalStrategy(int numberOfLocalIndices, long numberOfDocuments)Creates a new identity documental clustering strategy.
-
Method Summary
Modifier and Type Method Description longglobalPointer(int localIndex, long localPointer)Returns the global document pointer given a local index and a local document pointer.longlocalPointer(long globalPointer)Returns the local document pointer corresponding to a global document pointer.longnumberOfDocuments(int localIndex)Returns the number of documents that will be assigned to the given local index.intnumberOfLocalIndices()Returns the number of local indices handled by this strategy.StringtoString()
-
-
-
Method Detail
-
numberOfLocalIndices
public int numberOfLocalIndices()
Description copied from interface:ClusteringStrategyReturns the number of local indices handled by this strategy.- Specified by:
numberOfLocalIndicesin interfaceClusteringStrategy- Returns:
- the number of local indices handled by this strategy.
-
localPointer
public long localPointer(long globalPointer)
Description copied from interface:DocumentalClusteringStrategyReturns the local document pointer corresponding to a global document pointer.- Specified by:
localPointerin interfaceDocumentalClusteringStrategy- Parameters:
globalPointer- a global document pointer.- Returns:
- the corresponding local document pointer.
-
globalPointer
public long globalPointer(int localIndex, long localPointer)Description copied from interface:DocumentalClusteringStrategyReturns the global document pointer given a local index and a local document pointer.- Specified by:
globalPointerin interfaceDocumentalClusteringStrategy- Parameters:
localIndex- the local index.localPointer- the local document pointer inlocalIndex.- Returns:
- the global document pointer.
-
numberOfDocuments
public long numberOfDocuments(int localIndex)
Description copied from interface:DocumentalClusteringStrategyReturns the number of documents that will be assigned to the given local index.- Specified by:
numberOfDocumentsin interfaceDocumentalClusteringStrategy- Parameters:
localIndex- the local index.- Returns:
- the number of documents that will be assigned to
localIndex.
-
-