EMMA Coverage Report (generated Sun Mar 01 22:06:14 CET 2015)
[all classes][org.h2.index]

COVERAGE SUMMARY FOR SOURCE FILE [NonUniqueHashCursor.java]

nameclass, %method, %block, %line, %
NonUniqueHashCursor.java100% (1/1)0%   (0/5)0%   (0/75)0%   (0/12)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class NonUniqueHashCursor100% (1/1)0%   (0/5)0%   (0/75)0%   (0/12)
NonUniqueHashCursor (Session, RegularTable, ArrayList): void 0%   (0/1)0%   (0/15)0%   (0/6)
get (): Row 0%   (0/1)0%   (0/24)0%   (0/3)
getSearchRow (): SearchRow 0%   (0/1)0%   (0/3)0%   (0/1)
next (): boolean 0%   (0/1)0%   (0/18)0%   (0/1)
previous (): boolean 0%   (0/1)0%   (0/15)0%   (0/1)

1/*
2 * Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
3 * and the EPL 1.0 (http://h2database.com/html/license.html).
4 * Initial Developer: H2 Group
5 */
6package org.h2.index;
7 
8import java.util.ArrayList;
9import org.h2.engine.Session;
10import org.h2.result.Row;
11import org.h2.result.SearchRow;
12import org.h2.table.RegularTable;
13 
14/**
15 * Cursor implementation for non-unique hash index
16 *
17 * @author Sergi Vladykin
18 */
19public class NonUniqueHashCursor implements Cursor {
20 
21    private final Session session;
22    private final ArrayList<Long> positions;
23    private final RegularTable tableData;
24 
25    private int index = -1;
26 
27    public NonUniqueHashCursor(Session session, RegularTable tableData,
28            ArrayList<Long> positions) {
29        this.session = session;
30        this.tableData = tableData;
31        this.positions = positions;
32    }
33 
34    @Override
35    public Row get() {
36        if (index < 0 || index >= positions.size()) {
37            return null;
38        }
39        return tableData.getRow(session, positions.get(index));
40    }
41 
42    @Override
43    public SearchRow getSearchRow() {
44        return get();
45    }
46 
47    @Override
48    public boolean next() {
49        return positions != null && ++index < positions.size();
50    }
51 
52    @Override
53    public boolean previous() {
54        return positions != null && --index >= 0;
55    }
56 
57}

[all classes][org.h2.index]
EMMA 2.0.5312 (C) Vladimir Roubtsov