org.shiftone.exq.impl.query
Class CursorImpl

java.lang.Object
  extended byorg.shiftone.exq.impl.query.CursorImpl
All Implemented Interfaces:
Cursor, java.util.Map

public class CursorImpl
extends java.lang.Object
implements Cursor

Class CursorImpl contains a reference to a QueryResult and an index

Author:
Jeff Drost

Nested Class Summary
 
Nested classes inherited from class java.util.Map
java.util.Map.Entry
 
Field Summary
(package private)  java.lang.Object[] currentRowData
           
(package private)  int currentRowIndex
           
(package private)  int maxRow
           
(package private)  int minRow
           
(package private)  int numPages
           
(package private)  int pageNumber
           
(package private)  int rowCount
           
(package private)  int rowsPerPage
           
 
Constructor Summary
CursorImpl(QueryResult queryResult)
          Constructor CursorImpl
CursorImpl(QueryResult queryResult, int pageNumber, int rowsPerPage)
          Constructor CursorImpl
CursorImpl(QueryResult queryResult, int pageNumber, int rowsPerPage, int numPages)
          Constructor CursorImpl THIS IS A LYING STINKING CONSTRUCTOR.
 
Method Summary
 void clear()
          Removes all mappings from this map (optional operation).
 boolean containsKey(java.lang.Object key)
          Returns true if this map contains a mapping for the specified key.
 boolean containsValue(java.lang.Object value)
          Returns true if this map maps one or more keys to the specified value.
 java.util.Set entrySet()
          Returns a set view of the mappings contained in this map.
 boolean equals(java.lang.Object o)
          Compares the specified object with this map for equality.
 java.lang.Object get(java.lang.Object key)
          Returns the value to which this map maps the specified key.
 int getColumnCount()
          Method getColumnCount
 int getColumnIndex(java.lang.String name)
          Method getColumnIndex
 java.lang.String getColumnName(int index)
          Method getColumnName
 java.lang.Class getColumnType(int index)
          Method getColumnType
 int getPageCount()
          Method getPageCount
 int getPageNumber()
          Method getPageNumber
 int getRowCount()
          Method getRowCount
 int getRowNumber()
          Method getRowNumber
 java.lang.Object getValue(int columnIndex)
          Method getValue
 java.lang.Object getValue(java.lang.String columnName)
          Method getValue
 int hashCode()
          Returns the hash code value for this map.
 boolean isEmpty()
          Returns true if this map contains no key-value mappings.
 java.util.Set keySet()
          Returns a set view of the keys contained in this map.
 boolean next()
          Method next
 java.lang.Object put(java.lang.Object key, java.lang.Object value)
          Associates the specified value with the specified key in this map (optional operation).
 void putAll(java.util.Map t)
          Copies all of the mappings from the specified map to this map (optional operation).
 java.lang.Object remove(java.lang.Object key)
          Removes the mapping for this key from this map if it is present (optional operation).
 void reset()
          Method reset
 int size()
          Returns the number of key-value mappings in this map.
 java.util.Collection values()
          Returns a collection view of the values contained in this map.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

rowCount

int rowCount

minRow

int minRow

maxRow

int maxRow

numPages

int numPages

rowsPerPage

int rowsPerPage

pageNumber

int pageNumber

currentRowIndex

int currentRowIndex

currentRowData

java.lang.Object[] currentRowData
Constructor Detail

CursorImpl

public CursorImpl(QueryResult queryResult)
Constructor CursorImpl

Parameters:
queryResult -

CursorImpl

public CursorImpl(QueryResult queryResult,
                  int pageNumber,
                  int rowsPerPage)
Constructor CursorImpl

Parameters:
queryResult -
pageNumber - zero based page number
rowsPerPage - number of rows that should appear per page

CursorImpl

public CursorImpl(QueryResult queryResult,
                  int pageNumber,
                  int rowsPerPage,
                  int numPages)
Constructor CursorImpl THIS IS A LYING STINKING CONSTRUCTOR. IT LIES, IT CHEATS, IT DEFEATS! It was all Jeff's idea.

Parameters:
queryResult -
pageNumber -
rowsPerPage -
numPages -
Method Detail

reset

public void reset()
Method reset

Specified by:
reset in interface Cursor

next

public final boolean next()
Method next

Specified by:
next in interface Cursor

getPageCount

public int getPageCount()
Method getPageCount

Specified by:
getPageCount in interface Cursor

getPageNumber

public int getPageNumber()
Method getPageNumber

Specified by:
getPageNumber in interface Cursor

getColumnCount

public int getColumnCount()
Method getColumnCount

Specified by:
getColumnCount in interface Cursor

getColumnName

public java.lang.String getColumnName(int index)
Method getColumnName

Specified by:
getColumnName in interface Cursor
Parameters:
index -

getColumnType

public java.lang.Class getColumnType(int index)
Method getColumnType

Specified by:
getColumnType in interface Cursor
Parameters:
index -

getColumnIndex

public int getColumnIndex(java.lang.String name)
Method getColumnIndex

Specified by:
getColumnIndex in interface Cursor
Parameters:
name -

getRowCount

public final int getRowCount()
Method getRowCount

Specified by:
getRowCount in interface Cursor

getRowNumber

public final int getRowNumber()
Method getRowNumber

Specified by:
getRowNumber in interface Cursor

getValue

public final java.lang.Object getValue(java.lang.String columnName)
Method getValue

Specified by:
getValue in interface Cursor
Parameters:
columnName -

getValue

public final java.lang.Object getValue(int columnIndex)
Method getValue

Specified by:
getValue in interface Cursor
Parameters:
columnIndex -

clear

public void clear()
Removes all mappings from this map (optional operation).

Specified by:
clear in interface java.util.Map

containsKey

public boolean containsKey(java.lang.Object key)
Returns true if this map contains a mapping for the specified key.

Specified by:
containsKey in interface java.util.Map
Parameters:
key -

containsValue

public boolean containsValue(java.lang.Object value)
Returns true if this map maps one or more keys to the specified value.

Specified by:
containsValue in interface java.util.Map
Parameters:
value -

entrySet

public java.util.Set entrySet()
Returns a set view of the mappings contained in this map. this method returns an unmodifiable Set

Specified by:
entrySet in interface java.util.Map

equals

public boolean equals(java.lang.Object o)
Compares the specified object with this map for equality.
Returns true if the given object is also a map and the two Maps represent the same mappings. More formally, two maps t1 and t2 represent the same mappings if t1.entrySet().equals(t2.entrySet()). This ensures that the equals method works properly across different implementations of the Map interface.

Specified by:
equals in interface java.util.Map
Parameters:
o -

get

public java.lang.Object get(java.lang.Object key)
Returns the value to which this map maps the specified key.

Specified by:
get in interface java.util.Map
Parameters:
key -

hashCode

public int hashCode()
Returns the hash code value for this map. Returns the hash code value for this map. The hash code of a map is defined to be the sum of the hashCodes of each entry in the map's entrySet view. This ensures that t1.equals(t2) implies that t1.hashCode()==t2.hashCode() for any two maps t1 and t2, as required by the general contract of Object.hashCode.

Specified by:
hashCode in interface java.util.Map

isEmpty

public boolean isEmpty()
Returns true if this map contains no key-value mappings.

Specified by:
isEmpty in interface java.util.Map

keySet

public java.util.Set keySet()
Returns a set view of the keys contained in this map.

Specified by:
keySet in interface java.util.Map

put

public java.lang.Object put(java.lang.Object key,
                            java.lang.Object value)
Associates the specified value with the specified key in this map (optional operation).

Specified by:
put in interface java.util.Map
Parameters:
key -
value -

putAll

public void putAll(java.util.Map t)
Copies all of the mappings from the specified map to this map (optional operation).

Specified by:
putAll in interface java.util.Map
Parameters:
t -

remove

public java.lang.Object remove(java.lang.Object key)
Removes the mapping for this key from this map if it is present (optional operation).

Specified by:
remove in interface java.util.Map
Parameters:
key -

size

public int size()
Returns the number of key-value mappings in this map.

Specified by:
size in interface java.util.Map

values

public java.util.Collection values()
Returns a collection view of the values contained in this map.

Specified by:
values in interface java.util.Map