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

COVERAGE SUMMARY FOR SOURCE FILE [SingleRowCursor.java]

nameclass, %method, %block, %line, %
SingleRowCursor.java100% (1/1)0%   (0/5)0%   (0/30)0%   (0/11)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class SingleRowCursor100% (1/1)0%   (0/5)0%   (0/30)0%   (0/11)
SingleRowCursor (Row): void 0%   (0/1)0%   (0/6)0%   (0/3)
get (): Row 0%   (0/1)0%   (0/3)0%   (0/1)
getSearchRow (): SearchRow 0%   (0/1)0%   (0/3)0%   (0/1)
next (): boolean 0%   (0/1)0%   (0/16)0%   (0/5)
previous (): boolean 0%   (0/1)0%   (0/2)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 org.h2.message.DbException;
9import org.h2.result.Row;
10import org.h2.result.SearchRow;
11 
12/**
13 * A cursor with at most one row.
14 */
15public class SingleRowCursor implements Cursor {
16    private Row row;
17    private boolean end;
18 
19    /**
20     * Create a new cursor.
21     *
22     * @param row - the single row (if null then cursor is empty)
23     */
24    public SingleRowCursor(Row row) {
25        this.row = row;
26    }
27 
28    @Override
29    public Row get() {
30        return row;
31    }
32 
33    @Override
34    public SearchRow getSearchRow() {
35        return row;
36    }
37 
38    @Override
39    public boolean next() {
40        if (row == null || end) {
41            row = null;
42            return false;
43        }
44        end = true;
45        return true;
46    }
47 
48    @Override
49    public boolean previous() {
50        throw DbException.throwInternalError();
51    }
52 
53}

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