dk.vajhoej.isam.dummy
Class DummyIsamSource

java.lang.Object
  extended by dk.vajhoej.isam.dummy.DummyIsamSource
All Implemented Interfaces:
IsamSource

public class DummyIsamSource
extends java.lang.Object
implements IsamSource

Class DummyIsamSource is a "do nothing" implementation of ISAM source. All writes succeed. All reads return nothing. It is only intended for testing purposes.


Constructor Summary
DummyIsamSource()
           
 
Method Summary
 void close()
          Close ISAM source.
<T> void
create(T o)
          Create record in ISAM source.
<T,TK> void
delete(java.lang.Class<T> t, Key<TK> k)
          Delete record from ISAM source.
<T,TK> T
read(java.lang.Class<T> t, Key<TK> k)
          Read record from ISAM source.
<T,TK> IsamResult<T>
readGE(java.lang.Class<T> t, Key<TK> k)
          Find all records greater than or equal key.
<T,TK> IsamResult<T>
readGT(java.lang.Class<T> t, Key<TK> k)
          Read all records greater than key.
<T,TK> IsamResult<T>
readLE(java.lang.Class<T> t, Key<TK> k)
          Read all records less than or equal key.
<T,TK> IsamResult<T>
readLT(java.lang.Class<T> t, Key<TK> k)
          Read all records less than key.
<T> void
update(T o)
          Update record in ISAM source.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DummyIsamSource

public DummyIsamSource()
Method Detail

read

public <T,TK> T read(java.lang.Class<T> t,
                     Key<TK> k)
       throws IsamException,
              RecordException
Description copied from interface: IsamSource
Read record from ISAM source.

Specified by:
read in interface IsamSource
Parameters:
t - type to read
k - key of record to read
Returns:
object read
Throws:
IsamException - if problem with ISAM source
RecordException - if problem converting data

create

public <T> void create(T o)
            throws IsamException,
                   RecordException
Description copied from interface: IsamSource
Create record in ISAM source.

Specified by:
create in interface IsamSource
Parameters:
o - object to create
Throws:
IsamException - if problem with ISAM source
RecordException - if problem converting data

update

public <T> void update(T o)
            throws IsamException,
                   RecordException
Description copied from interface: IsamSource
Update record in ISAM source.

Specified by:
update in interface IsamSource
Parameters:
o - object to update
Throws:
IsamException - if problem with ISAM source
RecordException - if problem converting data

delete

public <T,TK> void delete(java.lang.Class<T> t,
                          Key<TK> k)
            throws IsamException,
                   RecordException
Description copied from interface: IsamSource
Delete record from ISAM source.

Specified by:
delete in interface IsamSource
Parameters:
t - type to delete
k - key of record to delete
Throws:
IsamException - if problem with ISAM source
RecordException - if problem converting data

close

public void close()
           throws IsamException
Description copied from interface: IsamSource
Close ISAM source.

Specified by:
close in interface IsamSource
Throws:
IsamException - if problem with ISAM source

readGE

public <T,TK> IsamResult<T> readGE(java.lang.Class<T> t,
                                   Key<TK> k)
                     throws IsamException,
                            RecordException
Description copied from interface: IsamSource
Find all records greater than or equal key.

Specified by:
readGE in interface IsamSource
Parameters:
t - type to find
k - key to find
Returns:
result
Throws:
IsamException - if problem with ISAM source
RecordException - if problem converting data

readGT

public <T,TK> IsamResult<T> readGT(java.lang.Class<T> t,
                                   Key<TK> k)
                     throws IsamException,
                            RecordException
Description copied from interface: IsamSource
Read all records greater than key.

Specified by:
readGT in interface IsamSource
Parameters:
t - type to find
k - key to find
Returns:
result
Throws:
IsamException - if problem with ISAM source
RecordException - if problem converting data

readLE

public <T,TK> IsamResult<T> readLE(java.lang.Class<T> t,
                                   Key<TK> k)
                     throws IsamException,
                            RecordException
Description copied from interface: IsamSource
Read all records less than or equal key. Note that the performance of reading reverse may be very poor in some implementations.

Specified by:
readLE in interface IsamSource
Parameters:
t - type to find
k - key to find
Returns:
result
Throws:
IsamException - if problem with ISAM source
RecordException - if problem converting data

readLT

public <T,TK> IsamResult<T> readLT(java.lang.Class<T> t,
                                   Key<TK> k)
                     throws IsamException,
                            RecordException
Description copied from interface: IsamSource
Read all records less than key. Note that the performance of reading reverse may be very poor in some implementations.

Specified by:
readLT in interface IsamSource
Parameters:
t - type to find
k - key to find
Returns:
result
Throws:
IsamException - if problem with ISAM source
RecordException - if problem converting data