jdbreport.source
Class BufferedDataSet

java.lang.Object
  extended by jdbreport.source.BufferedDataSet
All Implemented Interfaces:
Cloneable, EventListener, DataSetListener, MasterDataSet, ReportDataSet

public class BufferedDataSet
extends Object
implements MasterDataSet, DataSetListener

Version:
2.0 21.01.2011
Author:
Andrey Kholmanskih

Field Summary
protected  EventListenerList listenerList
           
 
Constructor Summary
BufferedDataSet(ReportDataSet ds)
           
BufferedDataSet(ReportDataSet ds, Map<Object,Object> vars)
           
 
Method Summary
 void addDataSetListener(DataSetListener listener)
           
 boolean checkParamsChange(MasterDataSet masterDS)
           
 Object clone()
           
 void cursorChange(CursorChangedEvent evt)
           
 boolean findColumn(String name)
           
 void fireDataSetCursorChanged()
           
 Collection<String> getColumnNames()
          Returns names' collection of columns or properties
 Object getCurrentObject()
          Returns a current object, can be null
 String getId()
           
 String getMasterId()
          Returns id of the leading DataSet
 Object getNextValue(String name)
           
 and.dbcomp.DataSetParams getParams()
          Returns parameters
 Object getValue(String name)
          Returns value from the current record (object) by the name
 Map<Object,Object> getVars()
           
 boolean hasNext()
           
 boolean isCursorChange()
           
 boolean isDsEof()
           
 boolean isEof()
           
 boolean next()
          Moves the cursor on the next record (object) in the DataSet
 void open()
           
 void removeDataSetListener(DataSetListener listener)
           
 boolean reopen()
          Reopens the DataSet when the MasterDataSet changes parameters
 void resetCursorPos()
           
 void setVars(Map<Object,Object> vars)
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

listenerList

protected EventListenerList listenerList
Constructor Detail

BufferedDataSet

public BufferedDataSet(ReportDataSet ds)

BufferedDataSet

public BufferedDataSet(ReportDataSet ds,
                       Map<Object,Object> vars)
Method Detail

setVars

public void setVars(Map<Object,Object> vars)

getVars

public Map<Object,Object> getVars()

open

public void open()
          throws ReportException
Throws:
ReportException

reopen

public boolean reopen()
               throws ReportException
Description copied from interface: ReportDataSet
Reopens the DataSet when the MasterDataSet changes parameters

Specified by:
reopen in interface ReportDataSet
Returns:
true if not eof
Throws:
ReportException

next

public boolean next()
             throws ReportException
Description copied from interface: ReportDataSet
Moves the cursor on the next record (object) in the DataSet

Specified by:
next in interface ReportDataSet
Returns:
true if successful
Throws:
ReportException

getValue

public Object getValue(String name)
                throws ReportException
Description copied from interface: ReportDataSet
Returns value from the current record (object) by the name

Specified by:
getValue in interface ReportDataSet
Parameters:
name - - the column's name or the property's name
Returns:
value by the name
Throws:
ReportException

findColumn

public boolean findColumn(String name)

getId

public String getId()
Specified by:
getId in interface ReportDataSet
Returns:
DataSet id

clone

public Object clone()
Specified by:
clone in interface ReportDataSet
Overrides:
clone in class Object

getColumnNames

public Collection<String> getColumnNames()
                                  throws ReportException
Description copied from interface: ReportDataSet
Returns names' collection of columns or properties

Specified by:
getColumnNames in interface ReportDataSet
Returns:
names of columns or properties
Throws:
ReportException

getNextValue

public Object getNextValue(String name)
                    throws ReportException
Throws:
ReportException

isDsEof

public boolean isDsEof()

isEof

public boolean isEof()

addDataSetListener

public void addDataSetListener(DataSetListener listener)
Specified by:
addDataSetListener in interface MasterDataSet

removeDataSetListener

public void removeDataSetListener(DataSetListener listener)
Specified by:
removeDataSetListener in interface MasterDataSet

fireDataSetCursorChanged

public void fireDataSetCursorChanged()

getParams

public and.dbcomp.DataSetParams getParams()
                                   throws ReportException
Description copied from interface: ReportDataSet
Returns parameters

Specified by:
getParams in interface ReportDataSet
Returns:
parameters
Throws:
ReportException

checkParamsChange

public boolean checkParamsChange(MasterDataSet masterDS)

cursorChange

public void cursorChange(CursorChangedEvent evt)
Specified by:
cursorChange in interface DataSetListener

getMasterId

public String getMasterId()
Description copied from interface: ReportDataSet
Returns id of the leading DataSet

Specified by:
getMasterId in interface ReportDataSet
Returns:
masterId property

resetCursorPos

public void resetCursorPos()

isCursorChange

public boolean isCursorChange()

getCurrentObject

public Object getCurrentObject()
Description copied from interface: ReportDataSet
Returns a current object, can be null

Specified by:
getCurrentObject in interface ReportDataSet
Returns:
- current object

hasNext

public boolean hasNext()
Specified by:
hasNext in interface ReportDataSet