com.arsdigita.acs
Class VectorDataSource

java.lang.Object
  |
  +--com.arsdigita.acs.VectorDataSource
All Implemented Interfaces:
DataSource

public class VectorDataSource
extends Object
implements DataSource

datasource wrapper for a Vector of SingleSelections. Useful when we have a query from a database that we might want to loop over several times. This also allows us to use Vectors as sources of ad:loop.


Constructor Summary
VectorDataSource(Vector v)
          creates a new VectorDataSource from a Vector of DataSources.
 
Method Summary
 boolean contains(String key)
          Returns true if column is a valid column in this datasource; returns false otherwise.
 String get(String key)
          Generic get-property method; returns the value of the column named by key for the currently active
 String[] keys()
          Returns a list of valid keys in this datasource, for use with get().
 boolean next()
          Advances to the next item, if there is one, and returns true; returns false otherwise.
 void reset()
          rewinds this datasource to the beginning so we can loop over it again.
 int rownum()
          Returns the current row number in the datasource.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VectorDataSource

public VectorDataSource(Vector v)
creates a new VectorDataSource from a Vector of DataSources.
Method Detail

next

public boolean next()
Description copied from interface: DataSource
Advances to the next item, if there is one, and returns true; returns false otherwise.
Specified by:
next in interface DataSource

get

public String get(String key)
           throws DataSourceException
Description copied from interface: DataSource
Generic get-property method; returns the value of the column named by key for the currently active
Specified by:
get in interface DataSource

contains

public boolean contains(String key)
                 throws DataSourceException
Description copied from interface: DataSource
Returns true if column is a valid column in this datasource; returns false otherwise.
Specified by:
contains in interface DataSource

keys

public String[] keys()
              throws DataSourceException
Description copied from interface: DataSource
Returns a list of valid keys in this datasource, for use with get().
Specified by:
keys in interface DataSource

rownum

public int rownum()
Description copied from interface: DataSource
Returns the current row number in the datasource.
Specified by:
rownum in interface DataSource

reset

public void reset()
rewinds this datasource to the beginning so we can loop over it again.