jremote jbase5.2.1

com.jbase.jremote.protocol
Class JSelectListProt

java.lang.Object
  extended by com.jbase.jremote.protocol.JSelectListProt
All Implemented Interfaces:
JBaseSerializable

public class JSelectListProt
extends java.lang.Object
implements JBaseSerializable

A serializable list of jBASE file records.


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.jbase.jremote.io.JBaseSerializable
JBaseSerializable.TYPE
 
Field Summary
protected  java.nio.charset.CharsetDecoder _decoder
           
protected  java.nio.charset.CharsetEncoder _encoder
           
protected  boolean hasRecords
           
protected  int id
           
protected  java.util.List<java.lang.String> keys
           
protected  int position
           
protected  java.util.List<JDynArray> records
           
protected  java.util.HashSet<java.lang.Integer> updatedRecords
           
 
Constructor Summary
JSelectListProt()
          Constructs an empty list
JSelectListProt(JDynArray keys)
          Constructs a select list from specified dynamic array.
JSelectListProt(JSelectListProt sl, boolean copyModifiedOnly)
          Copy constructor
 
Method Summary
 int getId()
          Returns the ID of this select list.
 java.lang.String getKey()
          Obtains the current key.
 int getNumModified()
          Returns the number if modified records
 int getPosition()
          Returns the current position.
 JDynArray getRecord()
          Obtains the current record value.
 int getType()
           
 int getVersion()
           
 void goToPosition(int position)
          Move to the specified position.
 boolean hasNext()
          Returns whether it is possible to move forward.
 boolean hasPrevious()
          Returns whether it is possible to move backwards.
 boolean hasRecordData()
          Indicates whether this select list contains record data.
 boolean next()
          Move to next item.
 boolean previous()
          Move to previous item.
 void readObject(JBaseObjectReader reader, int version)
          Serialize object
 void setCharsetDecoder(java.nio.charset.CharsetDecoder decoder)
           
 void setCharsetEncoder(java.nio.charset.CharsetEncoder encoder)
           
 void setHasRecordData(boolean hasRecords)
          Mark select list to contain record data.
 void setRecord(JDynArray record)
          Modifies the value of the current record
 int size()
          Returns the no.
 void writeObject(JBaseObjectWriter writer, int version)
          Serialize object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

id

protected int id

position

protected int position

hasRecords

protected boolean hasRecords

keys

protected java.util.List<java.lang.String> keys

records

protected java.util.List<JDynArray> records

updatedRecords

protected java.util.HashSet<java.lang.Integer> updatedRecords

_encoder

protected java.nio.charset.CharsetEncoder _encoder

_decoder

protected java.nio.charset.CharsetDecoder _decoder
Constructor Detail

JSelectListProt

public JSelectListProt()
Constructs an empty list


JSelectListProt

public JSelectListProt(JDynArray keys)
Constructs a select list from specified dynamic array.

Parameters:
keys - Dynamic array containing keys separated by attribute markers.

JSelectListProt

public JSelectListProt(JSelectListProt sl,
                       boolean copyModifiedOnly)
Copy constructor

Parameters:
sl -
copyModifiedOnly - if true, copies modified items only.
Method Detail

setCharsetEncoder

public void setCharsetEncoder(java.nio.charset.CharsetEncoder encoder)

setCharsetDecoder

public void setCharsetDecoder(java.nio.charset.CharsetDecoder decoder)

getId

public int getId()
Returns the ID of this select list.

Returns:

size

public int size()
Returns the no. of items inside this select list.

Returns:

hasRecordData

public boolean hasRecordData()
Indicates whether this select list contains record data.

Returns:

setHasRecordData

public void setHasRecordData(boolean hasRecords)
Mark select list to contain record data.

Parameters:
hasRecords -

getKey

public java.lang.String getKey()
Obtains the current key.

Returns:
key

getRecord

public JDynArray getRecord()
Obtains the current record value.

Returns:
record value

setRecord

public void setRecord(JDynArray record)
Modifies the value of the current record

Parameters:
record -

getNumModified

public int getNumModified()
Returns the number if modified records

Returns:

next

public boolean next()
             throws JRemoteException
Move to next item.

Returns:
true if OK, false otherwise
Throws:
JRemoteException

previous

public boolean previous()
                 throws JRemoteException
Move to previous item.

Returns:
true if OK, false otherwise
Throws:
JRemoteException

hasNext

public boolean hasNext()
                throws JRemoteException
Returns whether it is possible to move forward.

Returns:
true if YES, false otherwise
Throws:
JRemoteException

hasPrevious

public boolean hasPrevious()
                    throws JRemoteException
Returns whether it is possible to move backwards.

Returns:
true if YES, false otherwise
Throws:
JRemoteException

getPosition

public int getPosition()
Returns the current position. The first item in the list has position 1.

Returns:

goToPosition

public void goToPosition(int position)
Move to the specified position. The first item in the list has position 1.

Parameters:
position -

writeObject

public void writeObject(JBaseObjectWriter writer,
                        int version)
                 throws java.io.IOException
Serialize object

Specified by:
writeObject in interface JBaseSerializable
Throws:
java.io.IOException

readObject

public void readObject(JBaseObjectReader reader,
                       int version)
                throws java.io.IOException,
                       java.lang.ClassNotFoundException
Serialize object

Specified by:
readObject in interface JBaseSerializable
Throws:
java.io.IOException
java.lang.ClassNotFoundException

getType

public int getType()
Specified by:
getType in interface JBaseSerializable
Returns:
type id of the objects, used during the serialization

getVersion

public int getVersion()
Specified by:
getVersion in interface JBaseSerializable

jremote jbase5.2.1

Copyright © 2010 TEMENOS. All Rights Reserved.