blob: eda8bf78b68ac807e19cd4010d19fdd0c0e6241f (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.search.query.profile;
import com.yahoo.processing.request.CompoundName;
import com.yahoo.search.query.profile.types.FieldDescription;
import com.yahoo.search.query.profile.types.QueryProfileFieldType;
import com.yahoo.search.query.profile.types.QueryProfileType;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
/**
* @author bratseth
*/
final class AllReferencesQueryProfileVisitor extends PrefixQueryProfileVisitor {
/** A map of query profile types */
private Set<CompoundName> references = new HashSet<>();
public AllReferencesQueryProfileVisitor(CompoundName prefix) {
super(prefix);
}
@Override
public void onValue(String name, Object value,
DimensionBinding binding,
QueryProfile owner,
DimensionValues variant) {}
@Override
public void onQueryProfileInsidePrefix(QueryProfile profile,
DimensionBinding binding,
QueryProfile owner,
DimensionValues variant) {
references.add(currentPrefix);
}
/** Returns the values resulting from this visiting */
public Set<CompoundName> getResult() { return references; }
/** Returns false - we are not done until we have seen all */
public boolean isDone() { return false; }
}
|