jremote jbase5.2.1

com.jbase.jremote.io
Class JSelectListImpl

java.lang.Object
  extended by com.jbase.jremote.io.JSelectListImpl
All Implemented Interfaces:
JSelectList, java.lang.Iterable<java.lang.String>
Direct Known Subclasses:
JCursorImpl

public class JSelectListImpl
extends java.lang.Object
implements JSelectList

A select list to a jBASE file.

This object represents a list of record keys to a jBASE file.


Field Summary
protected  AbstractJRemoteConnection connection
           
protected  int cursorStartPos
           
protected  JSelectListProt data
           
protected static int FETCH_BACKWARD
           
protected static int FETCH_FORWARD
           
protected  int fetchSize
           
 
Constructor Summary
JSelectListImpl(AbstractJRemoteConnection connection, JDynArray keys)
          Constructs a select list from specified dynamic array.
JSelectListImpl(AbstractJRemoteConnection connection, JSelectListProt data)
          Constructs a select list from a serializable select list.
 
Method Summary
 void close()
          Close select list.
protected  JSelectListProt fetchNext(boolean fetchData)
           
protected  JSelectListProt fetchPrevious(boolean fetchData)
           
 JSelectListProt getData()
          Obtains a reference to the serializable part of the select list
 int getFetchSize()
          Returns the fetch size.
 java.lang.String getKey()
          Returns the current key
 int getPosition()
          Returns the current position.
 void goToPosition(int targetPos)
          Move to the specified position.
 boolean hasNext()
          Returns whether it is possible to move forward.
protected  boolean hasNext(boolean fetchData)
           
 boolean hasPrevious()
          Returns whether it is possible to move backwards.
protected  boolean hasPrevious(boolean fetchData)
           
 java.util.Iterator<java.lang.String> iterator()
          Returns an iterator to the select list
 boolean next()
          Move to next item
protected  boolean next(boolean fetchData)
           
 boolean previous()
          Move to previous item
protected  boolean previous(boolean fetchData)
           
 void setConnection(AbstractJRemoteConnection connection)
          Attaches a connection handle to this select list.
 void setFetchSize(int fetchSize)
          Sets the fetch size.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

connection

protected AbstractJRemoteConnection connection

data

protected JSelectListProt data

fetchSize

protected int fetchSize

cursorStartPos

protected int cursorStartPos

FETCH_FORWARD

protected static final int FETCH_FORWARD
See Also:
Constant Field Values

FETCH_BACKWARD

protected static final int FETCH_BACKWARD
See Also:
Constant Field Values
Constructor Detail

JSelectListImpl

public JSelectListImpl(AbstractJRemoteConnection connection,
                       JDynArray keys)
Constructs a select list from specified dynamic array.

Parameters:
connection - Connection handle used to fetch items from server
keys - Dynamic array containing keys separated by attribute markers.

JSelectListImpl

public JSelectListImpl(AbstractJRemoteConnection connection,
                       JSelectListProt data)
Constructs a select list from a serializable select list.

Parameters:
connection - Connection handle used to fetch items from server
data - Serializable select list
Method Detail

getKey

public java.lang.String getKey()
Description copied from interface: JSelectList
Returns the current key

Specified by:
getKey in interface JSelectList
Returns:
key
See Also:
JSelectList.getKey()

getFetchSize

public int getFetchSize()
Description copied from interface: JSelectList
Returns the fetch size. This value represents the number of items fetched simultaneously from the server.

Specified by:
getFetchSize in interface JSelectList
Returns:
fetch size
See Also:
JSelectList.getFetchSize()

setFetchSize

public void setFetchSize(int fetchSize)
Description copied from interface: JSelectList
Sets the fetch size.

Specified by:
setFetchSize in interface JSelectList
Parameters:
fetchSize - fetch size
See Also:
JSelectList.setFetchSize(int)

setConnection

public void setConnection(AbstractJRemoteConnection connection)
Attaches a connection handle to this select list. A connection is required to fetch items from the server.

Parameters:
connection - Connection handle

getData

public JSelectListProt getData()
Obtains a reference to the serializable part of the select list

Returns:
serializable select list

next

public boolean next()
             throws JRemoteException
Description copied from interface: JSelectList
Move to next item

Specified by:
next in interface JSelectList
Returns:
true if OK, false otherwise
Throws:
JRemoteException
See Also:
JSelectList.next()

previous

public boolean previous()
                 throws JRemoteException
Description copied from interface: JSelectList
Move to previous item

Specified by:
previous in interface JSelectList
Returns:
true if OK, false otherwise
Throws:
JRemoteException
See Also:
JSelectList.previous()

hasNext

public boolean hasNext()
                throws JRemoteException
Description copied from interface: JSelectList
Returns whether it is possible to move forward.

Specified by:
hasNext in interface JSelectList
Returns:
true if YES, false otherwise
Throws:
JRemoteException
See Also:
JSelectList.hasNext()

hasPrevious

public boolean hasPrevious()
                    throws JRemoteException
Description copied from interface: JSelectList
Returns whether it is possible to move backwards.

Specified by:
hasPrevious in interface JSelectList
Returns:
true if YES, false otherwise
Throws:
JRemoteException
See Also:
JSelectList.hasPrevious()

next

protected boolean next(boolean fetchData)
                throws JRemoteException
Throws:
JRemoteException

previous

protected boolean previous(boolean fetchData)
                    throws JRemoteException
Throws:
JRemoteException

hasNext

protected boolean hasNext(boolean fetchData)
                   throws JRemoteException
Throws:
JRemoteException

hasPrevious

protected boolean hasPrevious(boolean fetchData)
                       throws JRemoteException
Throws:
JRemoteException

getPosition

public int getPosition()
Description copied from interface: JSelectList
Returns the current position. The first item in the list has position 1.

Specified by:
getPosition in interface JSelectList
Returns:
position
See Also:
JSelectList.getPosition()

goToPosition

public void goToPosition(int targetPos)
                  throws JRemoteException
Description copied from interface: JSelectList
Move to the specified position. The first item in the list has position 1.

Specified by:
goToPosition in interface JSelectList
Throws:
JRemoteException
See Also:
com.jbase.jremote.JSelectList#goToPosition()

fetchNext

protected JSelectListProt fetchNext(boolean fetchData)
                             throws JRemoteException
Throws:
JRemoteException

fetchPrevious

protected JSelectListProt fetchPrevious(boolean fetchData)
                                 throws JRemoteException
Throws:
JRemoteException

close

public void close()
           throws JRemoteException
Description copied from interface: JSelectList
Close select list. Requests server to release all resources associated to this object.

Specified by:
close in interface JSelectList
Throws:
JRemoteException
See Also:
JSelectList.close()

iterator

public java.util.Iterator<java.lang.String> iterator()
Description copied from interface: JSelectList
Returns an iterator to the select list

Specified by:
iterator in interface JSelectList
Specified by:
iterator in interface java.lang.Iterable<java.lang.String>
Returns:
iterator
See Also:
JSelectList.iterator()

jremote jbase5.2.1

Copyright © 2010 TEMENOS. All Rights Reserved.