2
* Copyright Terracotta, Inc.
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
8
* http://www.apache.org/licenses/LICENSE-2.0
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
17
package net.sf.ehcache.search.impl;
19
import java.util.List;
22
import net.sf.ehcache.store.StoreQuery;
25
* Representation of single result row from group-by queries
29
public class GroupedResultImpl extends BaseResult {
30
private final Map<String, Object> attributes;
31
private final Object[] sortAttributes;
32
private final Map<String, Object> groupByValues;
39
* @param sortAttributes
40
* @param aggregatorResults
43
public GroupedResultImpl(StoreQuery query, Map<String, Object> attributes, Object[] sortAttributes,
44
List<Object> aggregatorResults, Map<String, Object> groupBy) {
46
this.attributes = attributes;
47
this.sortAttributes = sortAttributes;
48
this.groupByValues = groupBy;
49
setAggregateResults(aggregatorResults);
53
protected Object basicGetKey() {
54
throw new AssertionError("Not supported");
58
protected Object basicGetValue() {
59
throw new AssertionError("Not supported");
63
protected Object basicGetAttribute(String name) {
64
return attributes.get(name);
68
Object getSortAttribute(int pos) {
69
return sortAttributes[pos];
75
public Map<String, Object> getGroupByValues() {