com.j256.ormlite.android
Class AndroidDatabaseResults

java.lang.Object
  extended by com.j256.ormlite.android.AndroidDatabaseResults
All Implemented Interfaces:
com.j256.ormlite.support.DatabaseResults

public class AndroidDatabaseResults
extends Object
implements com.j256.ormlite.support.DatabaseResults

Android implementation of our results object.

Author:
kevingalligan, graywatson

Constructor Summary
AndroidDatabaseResults(android.database.Cursor cursor, boolean firstCall, com.j256.ormlite.dao.ObjectCache objectCache)
          Deprecated. The firstCall is no longer needed since the library now calls first() and next on its own.
AndroidDatabaseResults(android.database.Cursor cursor, com.j256.ormlite.dao.ObjectCache objectCache)
           
 
Method Summary
 void close()
           
 void closeQuietly()
           
 int findColumn(String columnName)
           
 boolean first()
           
 BigDecimal getBigDecimal(int columnIndex)
           
 InputStream getBlobStream(int columnIndex)
           
 boolean getBoolean(int columnIndex)
           
 byte getByte(int columnIndex)
           
 byte[] getBytes(int columnIndex)
           
 char getChar(int columnIndex)
           
 int getColumnCount()
           
 String[] getColumnNames()
           
 int getCount()
          Returns the count of results from the cursor.
 double getDouble(int columnIndex)
           
 float getFloat(int columnIndex)
           
 int getInt(int columnIndex)
           
 long getLong(int columnIndex)
           
 com.j256.ormlite.dao.ObjectCache getObjectCache()
           
 int getPosition()
          Returns the position of the cursor in the list of results.
 android.database.Cursor getRawCursor()
          Returns the underlying Android cursor object.
 short getShort(int columnIndex)
           
 String getString(int columnIndex)
           
 Timestamp getTimestamp(int columnIndex)
           
 boolean last()
           
 boolean moveAbsolute(int position)
           
 boolean moveRelative(int offset)
           
 boolean next()
           
 boolean previous()
           
 String toString()
           
 boolean wasNull(int columnIndex)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AndroidDatabaseResults

public AndroidDatabaseResults(android.database.Cursor cursor,
                              com.j256.ormlite.dao.ObjectCache objectCache)

AndroidDatabaseResults

@Deprecated
public AndroidDatabaseResults(android.database.Cursor cursor,
                                         boolean firstCall,
                                         com.j256.ormlite.dao.ObjectCache objectCache)
Deprecated. The firstCall is no longer needed since the library now calls first() and next on its own.

Constructor that allows you to inject a cursor that has already been configured with first-call set to false.

Method Detail

getColumnCount

public int getColumnCount()
Specified by:
getColumnCount in interface com.j256.ormlite.support.DatabaseResults

getColumnNames

public String[] getColumnNames()
Specified by:
getColumnNames in interface com.j256.ormlite.support.DatabaseResults

first

public boolean first()
Specified by:
first in interface com.j256.ormlite.support.DatabaseResults

next

public boolean next()
Specified by:
next in interface com.j256.ormlite.support.DatabaseResults

last

public boolean last()
Specified by:
last in interface com.j256.ormlite.support.DatabaseResults

previous

public boolean previous()
Specified by:
previous in interface com.j256.ormlite.support.DatabaseResults

moveRelative

public boolean moveRelative(int offset)
Specified by:
moveRelative in interface com.j256.ormlite.support.DatabaseResults

moveAbsolute

public boolean moveAbsolute(int position)
Specified by:
moveAbsolute in interface com.j256.ormlite.support.DatabaseResults

getCount

public int getCount()
Returns the count of results from the cursor.


getPosition

public int getPosition()
Returns the position of the cursor in the list of results.


findColumn

public int findColumn(String columnName)
               throws SQLException
Specified by:
findColumn in interface com.j256.ormlite.support.DatabaseResults
Throws:
SQLException

getString

public String getString(int columnIndex)
Specified by:
getString in interface com.j256.ormlite.support.DatabaseResults

getBoolean

public boolean getBoolean(int columnIndex)
Specified by:
getBoolean in interface com.j256.ormlite.support.DatabaseResults

getChar

public char getChar(int columnIndex)
             throws SQLException
Specified by:
getChar in interface com.j256.ormlite.support.DatabaseResults
Throws:
SQLException

getByte

public byte getByte(int columnIndex)
Specified by:
getByte in interface com.j256.ormlite.support.DatabaseResults

getBytes

public byte[] getBytes(int columnIndex)
Specified by:
getBytes in interface com.j256.ormlite.support.DatabaseResults

getShort

public short getShort(int columnIndex)
Specified by:
getShort in interface com.j256.ormlite.support.DatabaseResults

getInt

public int getInt(int columnIndex)
Specified by:
getInt in interface com.j256.ormlite.support.DatabaseResults

getLong

public long getLong(int columnIndex)
Specified by:
getLong in interface com.j256.ormlite.support.DatabaseResults

getFloat

public float getFloat(int columnIndex)
Specified by:
getFloat in interface com.j256.ormlite.support.DatabaseResults

getDouble

public double getDouble(int columnIndex)
Specified by:
getDouble in interface com.j256.ormlite.support.DatabaseResults

getTimestamp

public Timestamp getTimestamp(int columnIndex)
                       throws SQLException
Specified by:
getTimestamp in interface com.j256.ormlite.support.DatabaseResults
Throws:
SQLException

getBlobStream

public InputStream getBlobStream(int columnIndex)
Specified by:
getBlobStream in interface com.j256.ormlite.support.DatabaseResults

getBigDecimal

public BigDecimal getBigDecimal(int columnIndex)
                         throws SQLException
Specified by:
getBigDecimal in interface com.j256.ormlite.support.DatabaseResults
Throws:
SQLException

wasNull

public boolean wasNull(int columnIndex)
Specified by:
wasNull in interface com.j256.ormlite.support.DatabaseResults

getObjectCache

public com.j256.ormlite.dao.ObjectCache getObjectCache()
Specified by:
getObjectCache in interface com.j256.ormlite.support.DatabaseResults

close

public void close()
Specified by:
close in interface com.j256.ormlite.support.DatabaseResults

closeQuietly

public void closeQuietly()
Specified by:
closeQuietly in interface com.j256.ormlite.support.DatabaseResults

getRawCursor

public android.database.Cursor getRawCursor()
Returns the underlying Android cursor object. This should not be used unless you know what you are doing.


toString

public String toString()
Overrides:
toString in class Object


This documentation is licensed by Gray Watson under the Creative Commons Attribution-Share Alike 3.0 License.