1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.directory.server.xdbm;
20
21
22 import org.apache.directory.server.core.cursor.InvalidCursorPositionException;
23
24
25
26
27
28
29
30
31 public class EmptyIndexCursor<K,E> extends AbstractIndexCursor<K,E>
32 {
33 public boolean available()
34 {
35 return false;
36 }
37
38 public void before( IndexEntry<K,E> element ) throws Exception
39 {
40 checkNotClosed( "before()" );
41 }
42
43
44 public void after( IndexEntry<K,E> element ) throws Exception
45 {
46 checkNotClosed( "after()" );
47 }
48
49
50 public void beforeFirst() throws Exception
51 {
52 checkNotClosed( "beforeFirst()" );
53 }
54
55
56 public void afterLast() throws Exception
57 {
58 checkNotClosed( "afterLast()" );
59 }
60
61
62 public boolean first() throws Exception
63 {
64 checkNotClosed( "first()" );
65 return false;
66 }
67
68
69 public boolean last() throws Exception
70 {
71 checkNotClosed( "last()" );
72 return false;
73 }
74
75
76 public boolean previous() throws Exception
77 {
78 checkNotClosed( "previous()" );
79 return false;
80 }
81
82
83 public boolean next() throws Exception
84 {
85 checkNotClosed( "next()" );
86 return false;
87 }
88
89
90 public IndexEntry<K,E> get() throws Exception
91 {
92 checkNotClosed( "get()" );
93 throw new InvalidCursorPositionException( "This cursor is empty and cannot return elements!" );
94 }
95
96
97 public boolean isElementReused()
98 {
99 return false;
100 }
101
102 public void afterValue( Long id, K indexValue ) throws Exception
103 {
104 checkNotClosed( "after()" );
105 }
106
107 public void beforeValue( Long id, K indexValue ) throws Exception
108 {
109 checkNotClosed( "after()" );
110 }
111 }