1 package com.xtremelabs.robolectric.shadows; 2 3 import android.content.ContentResolver; 4 import android.database.*; 5 import android.net.Uri; 6 import android.os.Bundle; 7 import com.xtremelabs.robolectric.internal.Implementation; 8 import com.xtremelabs.robolectric.internal.Implements; 9 10 @Implements(CursorWrapper.class) 11 public class ShadowCursorWrapper implements Cursor { 12 private Cursor wrappedCursor; 13 14 public void __constructor__(Cursor c) { 15 wrappedCursor = c; 16 } 17 18 @Implementation 19 public int getCount() { 20 return wrappedCursor.getCount(); 21 } 22 23 @Implementation 24 public int getPosition() { 25 return wrappedCursor.getPosition(); 26 } 27 28 @Implementation 29 public boolean move(int i) { 30 return wrappedCursor.move(i); 31 } 32 33 @Implementation 34 public boolean moveToPosition(int i) { 35 return wrappedCursor.moveToPosition(i); 36 } 37 38 @Implementation 39 public boolean moveToFirst() { 40 return wrappedCursor.moveToFirst(); 41 } 42 43 @Implementation 44 public boolean moveToLast() { 45 return wrappedCursor.moveToLast(); 46 } 47 48 @Implementation 49 public boolean moveToNext() { 50 return wrappedCursor.moveToNext(); 51 } 52 53 @Implementation 54 public boolean moveToPrevious() { 55 return wrappedCursor.moveToPrevious(); 56 } 57 58 @Implementation 59 public boolean isFirst() { 60 return wrappedCursor.isFirst(); 61 } 62 63 @Implementation 64 public boolean isLast() { 65 return wrappedCursor.isLast(); 66 } 67 68 @Implementation 69 public boolean isBeforeFirst() { 70 return wrappedCursor.isBeforeFirst(); 71 } 72 73 @Implementation 74 public boolean isAfterLast() { 75 return wrappedCursor.isAfterLast(); 76 } 77 78 @Implementation 79 public int getColumnIndex(String s) { 80 return wrappedCursor.getColumnIndex(s); 81 } 82 83 @Implementation 84 public int getColumnIndexOrThrow(String s) throws IllegalArgumentException { 85 return wrappedCursor.getColumnIndexOrThrow(s); 86 } 87 88 @Implementation 89 public String getColumnName(int i) { 90 return wrappedCursor.getColumnName(i); 91 } 92 93 @Implementation 94 public String[] getColumnNames() { 95 return wrappedCursor.getColumnNames(); 96 } 97 98 @Implementation 99 public int getColumnCount() { 100 return wrappedCursor.getColumnCount(); 101 } 102 103 @Implementation 104 public byte[] getBlob(int i) { 105 return wrappedCursor.getBlob(i); 106 } 107 108 @Implementation 109 public String getString(int i) { 110 return wrappedCursor.getString(i); 111 } 112 113 @Implementation 114 public void copyStringToBuffer(int i, CharArrayBuffer charArrayBuffer) { 115 wrappedCursor.copyStringToBuffer(i, charArrayBuffer); 116 } 117 118 @Implementation 119 public short getShort(int i) { 120 return wrappedCursor.getShort(i); 121 } 122 123 @Implementation 124 public int getInt(int i) { 125 return wrappedCursor.getInt(i); 126 } 127 128 @Implementation 129 public long getLong(int i) { 130 return wrappedCursor.getLong(i); 131 } 132 133 @Implementation 134 public float getFloat(int i) { 135 return wrappedCursor.getFloat(i); 136 } 137 138 @Implementation 139 public double getDouble(int i) { 140 return wrappedCursor.getDouble(i); 141 } 142 143 @Implementation 144 public boolean isNull(int i) { 145 return wrappedCursor.isNull(i); 146 } 147 148 @Implementation 149 public void deactivate() { 150 wrappedCursor.deactivate(); 151 } 152 153 @Implementation 154 public boolean requery() { 155 return wrappedCursor.requery(); 156 } 157 158 @Implementation 159 public void close() { 160 wrappedCursor.close(); 161 } 162 163 @Implementation 164 public boolean isClosed() { 165 return wrappedCursor.isClosed(); 166 } 167 168 @Implementation 169 public void registerContentObserver(ContentObserver contentObserver) { 170 wrappedCursor.registerContentObserver(contentObserver); 171 } 172 173 @Implementation 174 public void unregisterContentObserver(ContentObserver contentObserver) { 175 wrappedCursor.unregisterContentObserver(contentObserver); 176 } 177 178 @Implementation 179 public void registerDataSetObserver(DataSetObserver dataSetObserver) { 180 wrappedCursor.registerDataSetObserver(dataSetObserver); 181 } 182 183 @Implementation 184 public void unregisterDataSetObserver(DataSetObserver dataSetObserver) { 185 wrappedCursor.unregisterDataSetObserver(dataSetObserver); 186 } 187 188 @Implementation 189 public void setNotificationUri(ContentResolver contentResolver, Uri uri) { 190 wrappedCursor.setNotificationUri(contentResolver, uri); 191 } 192 193 @Implementation 194 public boolean getWantsAllOnMoveCalls() { 195 return wrappedCursor.getWantsAllOnMoveCalls(); 196 } 197 198 @Implementation 199 public Bundle getExtras() { 200 return wrappedCursor.getExtras(); 201 } 202 203 @Implementation 204 public Bundle respond(Bundle bundle) { 205 return wrappedCursor.respond(bundle); 206 } 207 208 @Implementation 209 public int getType(int columnIndex) { 210 return 0; 211 } 212 213 @Implementation 214 public Cursor getWrappedCursor() { 215 return wrappedCursor; 216 } 217 218 } 219