org.cruxframework.crux.core.client.db
Class IDXCursor<K,V>

java.lang.Object
  extended by org.cruxframework.crux.core.client.db.IDXCursor<K,V>
Type Parameters:
K - The type of the key used to identify objects into the cursor.
V - The type of the objects referenced by this cursor
All Implemented Interfaces:
Cursor<K,V>
Direct Known Subclasses:
IDXFileCursor

public abstract class IDXCursor<K,V>
extends Object
implements Cursor<K,V>

CRUX INTERNAL CLASS. DO NOT USE IT DIRECTLY. Indexed DB implementation for Cursor Interface. Use the interface Cursor instead.

Author:
Thiago da Rosa de Bustamante

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.cruxframework.crux.core.client.db.Cursor
Cursor.CursorDirection
 
Field Summary
protected  IDBCursorWithValue idbCursor
           
 
Constructor Summary
protected IDXCursor(IDBCursorWithValue idbCursor)
           
 
Method Summary
 void advance(int count)
          Advance the cursor current position by a number of positions.
 void continueCursor()
          Make cursor to go to the next element.
abstract  void continueCursor(K key)
          Make cursor to go to the element referenced by the given key.
 void delete()
          Delete the current value, pointed by the cursor, from the database.
 Cursor.CursorDirection getDirection()
          Direction of iteration used by this cursor.
abstract  K getKey()
          Return the key of record pointed by the cursor.
abstract  com.google.gwt.core.client.JsArrayMixed getNativeArrayKey()
          Return the cursor key, as a native javascript object.
static IDBCursor.IDBCursorDirection getNativeCursorDirection(Cursor.CursorDirection direction)
           
<T extends com.google.gwt.core.client.JavaScriptObject>
T
getNativeValue()
           
abstract  V getValue()
          Return the value of record pointed by the cursor.
 boolean hasValue()
          Return true if cursor points to a valid value.
abstract  void update(V value)
          Update current record pointed by the cursor with the given value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

idbCursor

protected final IDBCursorWithValue idbCursor
Constructor Detail

IDXCursor

protected IDXCursor(IDBCursorWithValue idbCursor)
Method Detail

advance

public void advance(int count)
Description copied from interface: Cursor
Advance the cursor current position by a number of positions. Cursor callback onSuccess method will be called again, receiving the new value where cursor points after the advance.

Specified by:
advance in interface Cursor<K,V>
Parameters:
count - number of items to advance

continueCursor

public void continueCursor()
Description copied from interface: Cursor
Make cursor to go to the next element. Cursor callback onSuccess method will be called again, receiving the new value where cursor points after the advance.

Specified by:
continueCursor in interface Cursor<K,V>

delete

public void delete()
Description copied from interface: Cursor
Delete the current value, pointed by the cursor, from the database.

Specified by:
delete in interface Cursor<K,V>

getNativeValue

public <T extends com.google.gwt.core.client.JavaScriptObject> T getNativeValue()

hasValue

public boolean hasValue()
Description copied from interface: Cursor
Return true if cursor points to a valid value.

Specified by:
hasValue in interface Cursor<K,V>
Returns:
true if cursor points to a valid value

getDirection

public Cursor.CursorDirection getDirection()
Description copied from interface: Cursor
Direction of iteration used by this cursor.

Specified by:
getDirection in interface Cursor<K,V>
Returns:
cursor direction

getNativeCursorDirection

public static IDBCursor.IDBCursorDirection getNativeCursorDirection(Cursor.CursorDirection direction)

getNativeArrayKey

public abstract com.google.gwt.core.client.JsArrayMixed getNativeArrayKey()
Description copied from interface: Cursor
Return the cursor key, as a native javascript object.

Specified by:
getNativeArrayKey in interface Cursor<K,V>
Returns:
cursor key.

update

public abstract void update(V value)
Description copied from interface: Cursor
Update current record pointed by the cursor with the given value.

Specified by:
update in interface Cursor<K,V>
Parameters:
value - new value to update

getKey

public abstract K getKey()
Description copied from interface: Cursor
Return the key of record pointed by the cursor.

Specified by:
getKey in interface Cursor<K,V>
Returns:
key of the element pointed by the cursor

getValue

public abstract V getValue()
Description copied from interface: Cursor
Return the value of record pointed by the cursor.

Specified by:
getValue in interface Cursor<K,V>
Returns:
value of the element pointed by the cursor

continueCursor

public abstract void continueCursor(K key)
Description copied from interface: Cursor
Make cursor to go to the element referenced by the given key. Cursor callback onSuccess method will be called again, receiving the new value where cursor points after the advance.

Specified by:
continueCursor in interface Cursor<K,V>
Parameters:
key - key of the element to be pointed by the cursor.


Copyright © 2014. All rights reserved.