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 long
globalPointer(int localIndex, long localPointer)
Returns the global document pointer given a local index and a local document pointer.long
localPointer(long globalPointer)
Returns the local document pointer corresponding to a global document pointer.long
numberOfDocuments(int localIndex)
Returns the number of documents that will be assigned to the given local index.int
numberOfLocalIndices()
Returns the number of local indices handled by this strategy.String
toString()
-
-
-
Method Detail
-
numberOfLocalIndices
public int numberOfLocalIndices()
Description copied from interface:ClusteringStrategy
Returns the number of local indices handled by this strategy.- Specified by:
numberOfLocalIndices
in interfaceClusteringStrategy
- Returns:
- the number of local indices handled by this strategy.
-
localPointer
public long localPointer(long globalPointer)
Description copied from interface:DocumentalClusteringStrategy
Returns the local document pointer corresponding to a global document pointer.- Specified by:
localPointer
in 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:DocumentalClusteringStrategy
Returns the global document pointer given a local index and a local document pointer.- Specified by:
globalPointer
in 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:DocumentalClusteringStrategy
Returns the number of documents that will be assigned to the given local index.- Specified by:
numberOfDocuments
in interfaceDocumentalClusteringStrategy
- Parameters:
localIndex
- the local index.- Returns:
- the number of documents that will be assigned to
localIndex
.
-
-