Package it.unimi.di.big.mg4j.query.nodes
Class Remap
- java.lang.Object
-
- it.unimi.di.big.mg4j.query.nodes.Remap
-
- All Implemented Interfaces:
Query
,Serializable
public class Remap extends Object implements Query
A node representing an index remapping.A remapping takes results of the underlying
Query
for an internal index (which must be one of the indices for which the query provides results) and exhibits them as results of an external index. The map provided at construction time under the form of two parallel arrays should remap internal indices to external indices.- Author:
- Sebastiano Vigna
- See Also:
RemappingDocumentIterator
, Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description Object2ObjectLinkedOpenHashMap<String,String>
indexInverseRemapping
The remapping from external to internal indices.Object2ObjectLinkedOpenHashMap<String,String>
indexRemapping
The remapping from internal to external indices.Query
query
The only underlying node.
-
Constructor Summary
Constructors Constructor Description Remap(Query query, Object2ObjectMap<String,String> indexRemapping)
Creates a new index remapping query node given an index remapping.Remap(Query query, CharSequence[] internalIndex, CharSequence[] externalIndex)
Creates a new index remapping query node given explicit lists external and internal indices.
-
-
-
Field Detail
-
query
public final Query query
The only underlying node.
-
indexRemapping
public final Object2ObjectLinkedOpenHashMap<String,String> indexRemapping
The remapping from internal to external indices.
-
indexInverseRemapping
public final Object2ObjectLinkedOpenHashMap<String,String> indexInverseRemapping
The remapping from external to internal indices.
-
-
Constructor Detail
-
Remap
public Remap(Query query, CharSequence[] internalIndex, CharSequence[] externalIndex)
Creates a new index remapping query node given explicit lists external and internal indices.- Parameters:
query
- the underlying query.internalIndex
- the array of internal index names.externalIndex
- the array of external index names, parallel tointernalIndex
.
-
Remap
public Remap(Query query, Object2ObjectMap<String,String> indexRemapping)
Creates a new index remapping query node given an index remapping.- Parameters:
query
- the underlying query.indexRemapping
- a map from internal to external indices, which will be copied internally.
-
-
Method Detail
-
accept
public <T> T accept(QueryBuilderVisitor<T> visitor) throws QueryBuilderVisitorException
Description copied from interface:Query
Accepts a visitor.- Specified by:
accept
in interfaceQuery
- Parameters:
visitor
- the visitor.- Returns:
- the result of the visit, or
null
if the visit should stop. - Throws:
QueryBuilderVisitorException
- See Also:
Query
-
-