01: /*
02: Copyright (C) 2007 Mobixess Inc. http://www.java-objects-database.com
03:
04: This file is part of the JODB (Java Objects Database) open source project.
05:
06: JODB is free software; you can redistribute it and/or modify it under
07: the terms of version 2 of the GNU General Public License as published
08: by the Free Software Foundation.
09:
10: JODB is distributed in the hope that it will be useful, but WITHOUT ANY
11: WARRANTY; without even the implied warranty of MERCHANTABILITY or
12: FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13: for more details.
14:
15: You should have received a copy of the GNU General Public License along
16: with this program; if not, write to the Free Software Foundation, Inc.,
17: 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18: */
19: package com.mobixess.jodb.core.query;
20:
21: import java.nio.ByteBuffer;
22:
23: import com.mobixess.jodb.core.index.IndexDataIterator;
24:
25: public class LArrayIndexIterator implements IndexDataIterator {
26:
27: private long[] _array;
28: private int _index;
29:
30: /**
31: * @param array
32: */
33: public LArrayIndexIterator(long[] array) {
34: super ();
35: _array = array;
36: _index = -1;
37: }
38:
39: public boolean hasNext() {
40: return _index < _array.length - 1;
41: }
42:
43: public int length() {
44: return _array.length;
45: }
46:
47: public long next() {
48: return _array[++_index];
49: }
50:
51: public long next(ByteBuffer result) {
52: return next();
53: }
54:
55: }
|