danger.app
Class DataFinder

java.lang.Object
  |
  +--danger.app.DataFinder

public class DataFinder
extends java.lang.Object


Constructor Summary
DataFinder(DataStore ds, DataRecord template)
          Create a new DataFinder that searches the specified DataStore and uses the provided template DataRecord.
 
Method Summary
 DataRecord findNextContains(byte[] key, int row)
          Find the next record that contains the key string at the specified row (or null if no match)
 DataRecord findNextContains(byte[] key, int row, int col)
          Find the next record that contains the key string at the specified row and column (or null if no match)
 int getColumn()
          Return the column number of the last match or -1 if no match has been found yet
 int getLength()
          Return the length of the field that was last matched or -1 if there has not yet been a match.
 java.lang.String getMatchedString()
          Return a string containing the last match or null if there has not yet been a match.
 int getOffset()
          Return the offset into the underlying byte array of the field that was last matched or -1 if there has not yet been a match.
 int getRecordNumber()
          Return the record number of the last match or -1 if no match has been found yet
 void rewind()
          Next search will start at the first record.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataFinder

public DataFinder(DataStore ds,
                  DataRecord template)
Create a new DataFinder that searches the specified DataStore and uses the provided template DataRecord. While searching, the template is pointed at each record in turn and is expected to contain an appropriate rowcount for these records
Method Detail

rewind

public void rewind()
Next search will start at the first record.

findNextContains

public DataRecord findNextContains(byte[] key,
                                   int row,
                                   int col)
Find the next record that contains the key string at the specified row and column (or null if no match)

findNextContains

public DataRecord findNextContains(byte[] key,
                                   int row)
Find the next record that contains the key string at the specified row (or null if no match)

getRecordNumber

public int getRecordNumber()
Return the record number of the last match or -1 if no match has been found yet

getColumn

public int getColumn()
Return the column number of the last match or -1 if no match has been found yet

getOffset

public int getOffset()
Return the offset into the underlying byte array of the field that was last matched or -1 if there has not yet been a match.

getLength

public int getLength()
Return the length of the field that was last matched or -1 if there has not yet been a match.

getMatchedString

public java.lang.String getMatchedString()
Return a string containing the last match or null if there has not yet been a match.


Danger Confidential. Copyright © 2000-2003, Danger Inc.