|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectit.unimi.di.mg4j.index.cluster.ContiguousDocumentalStrategy
public class ContiguousDocumentalStrategy
A documental partitioning and clustering strategy that partitions an index into contiguous segments.
To partition an index in contiguous parts, you must provide an array of cutpoints, which define each part. More precisely, given cutpoints c0,c2,…,ck, the global index will be partitioned into k local indices containing the documents from c0 (included) to c1 (excluded), from c1 (included) to c2 and so on. Note that necessarily c0=0 and ck=N, where N is the number of globally indexed documents.
The properties() method provides two properties, pointerfrom and pointerto,
that contain the first (included) and last (excluded) pointer in the local index.
| Constructor Summary | |
|---|---|
ContiguousDocumentalStrategy(int... cutPoint)
Creates a new contiguous strategy with the given cutpoints. |
|
| Method Summary | |
|---|---|
int |
globalPointer(int localIndex,
int localPointer)
Returns the global document pointer given a local index and a local document pointer. |
int |
localIndex(int globalPointer)
Returns the index to which a given global document pointer is be mapped by this strategy. |
int |
localPointer(int globalPointer)
Returns the local document pointer corresponding to a global document pointer. |
int |
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 created by this strategy. |
Properties[] |
properties()
Returns an array of properties, one for each local index, that specify additional information about local indices. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ContiguousDocumentalStrategy(int... cutPoint)
Note that DocumentalStrategies has ready-made factory
methods for the common cases.
cutPoint - an array of cutpoints (see the class description}.| Method Detail |
|---|
public int numberOfLocalIndices()
PartitioningStrategy
numberOfLocalIndices in interface ClusteringStrategynumberOfLocalIndices in interface PartitioningStrategypublic int localIndex(int globalPointer)
DocumentalPartitioningStrategy
localIndex in interface DocumentalPartitioningStrategyglobalPointer - a global document pointer.
public int localPointer(int globalPointer)
DocumentalPartitioningStrategy
localPointer in interface DocumentalClusteringStrategylocalPointer in interface DocumentalPartitioningStrategyglobalPointer - a global document pointer.
public int globalPointer(int localIndex,
int localPointer)
DocumentalClusteringStrategy
globalPointer in interface DocumentalClusteringStrategylocalIndex - the local index.localPointer - the local document pointer in localIndex.
public int numberOfDocuments(int localIndex)
DocumentalPartitioningStrategy
numberOfDocuments in interface DocumentalClusteringStrategynumberOfDocuments in interface DocumentalPartitioningStrategylocalIndex - the local index.
localIndex.public Properties[] properties()
PartitioningStrategy
properties in interface PartitioningStrategynull (in that case, the set of properties is assumed to be empty).public String toString()
toString in class Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||