org::openisis::Db Class Reference

Inheritance diagram for org::openisis::Db:
org::openisis::NativeDb org::openisis::PureDb

List of all members.

Public Member Functions

abstract Rec readRow (int rowid)
abstract short writeRow (Rec rec)
abstract short writeXRow (Rec rec, Rec idx)
abstract Rec scanRow (int rowid, int tag, String txt)
abstract int[] search (String key, int mode)
abstract Iterator terms (String prefix)

Static Public Member Functions

static synchronized Db open (String dbname, String[] args) throws IOException
static int[] AND (int[] set, int[] nset)

Public Attributes

final String encoding

Static Public Attributes

static final String DEFAULT_ENCODING = "ISO-8859-1"
static final String EMPTY = ""
static final int QRY_KEYEQ = 0
static final int QRY_KEYPF = 1
static final int PREFIX = QRY_KEYPF
static final int QRY_KEYAT = 2
static final int QRY_SCANE = 64
static final int QRY_SCANC = 65
static final int QRY_SIMPLE = 128
static final int QRY_PROPER = 129
static final int MHL = 0x10000
static final int MD = 0x20000
static final int MDL = 0x30000
static final int MXU = 0x40000
static final int MHU = 0x50000
static final int MDU = 0x70000
static final int MI = 0x80000
static final int HTU = 0x100000
static final int HTI = 0x300000
static final int HTA = 0x700000
static final int PP = 0x2000000
static final int PS = 0x1000000
static final int DS = 0x4000000
static final int NS = 0x8000000
static final int LOCC = 0xffff << 16

Protected Member Functions

 Db (String enc)

Static Package Attributes

static final Map _dbs = new HashMap()

Detailed Description

This class represents an isis db. The actual implementation is done in derived classes.

Id
Db.java,v 1.6 2003/04/08 00:20:53 kripke Exp
Version:
Revision
1.6
Author:
Author
kripke

Member Function Documentation

static synchronized Db org::openisis::Db::open ( String  dbname,
String[]  args 
) throws IOException [inline, static]

open an isis database. The following options are supported as text-style parameters:

  • -db <name>
    basename of database. same as param dbname.
  • -dbpath <path>
    path to database. usefull when opening secondary indexes or other files whose names are not based on the db basename.
  • -v <level>
    set verbosity level
  • -encoding <enc>
    select encoding used in db bytes. default is DEFAULT_ENCODING.
  • -puredb
    select pure java implementation. by default the NativeDb is used.
Parameters:
dbname basename of database. the dbhome arg, if given, will be prepended, and the ISIS file extensions appended to build the actual filename. Therefore, depending on the value of dbhome and location of files, this may need to include a path. db may be null, if argv includes a dbname arg.
argv array of names and values. May be null. argv contains parameter names, which may be prefixed by a dash '-'. Depending on the actual parameter, the next string may or must contain a corresponding parameter value. An optional parameter value may be omitted, if at end of argv or the next name is prefixed with a dash. To avoid ambiguity, values never start with a dash. See above for a list of supported parameter names. Unrecognized parameter names are ignored.
Returns:
a new Db (unless some RuntimeException is thrown)
Exceptions:
IoException especially FileNotFoundExceptiond and UnsupportedEncodingException
abstract Rec org::openisis::Db::readRow ( int  rowid  )  [pure virtual]

read a cooked row.

Parameters:
rowid the mfn
Returns:
a Rec or null, if row not available.

Implemented in org::openisis::NativeDb, and org::openisis::PureDb.

abstract Rec org::openisis::Db::scanRow ( int  rowid,
int  tag,
String  txt 
) [pure virtual]

read the first row with rowid >= given rowid and containing txt in subfield tag (any, if 0).

Parameters:
rowid the mfn
Returns:
a Rec or null, if row not available.

Implemented in org::openisis::NativeDb, and org::openisis::PureDb.

abstract int [] org::openisis::Db::search ( String  key,
int  mode 
) [pure virtual]

read the array of rowids matching key.

Parameters:
key key to look for
mode one of the QRY_ constants above. may be ored with a tag<<16 to limit search to that field

Implemented in org::openisis::NativeDb, and org::openisis::PureDb.

abstract short org::openisis::Db::writeRow ( Rec  rec  )  [pure virtual]

write a cooked row.

Parameters:
row the Rec to be written
Returns:
0 if write succeeded, else a negative error code

Implemented in org::openisis::NativeDb, and org::openisis::PureDb.

abstract short org::openisis::Db::writeXRow ( Rec  rec,
Rec  idx 
) [pure virtual]

write a cooked row together with index information.

Parameters:
row the Rec to be written
Returns:
0 on success else a negative error code

Implemented in org::openisis::NativeDb, and org::openisis::PureDb.


Member Data Documentation

final String org::openisis::Db::DEFAULT_ENCODING = "ISO-8859-1" [static]

the default encoding. the constant String value is "ISO-8859-1".

final int org::openisis::Db::DS = 0x4000000 [static]

rec v: dummy presence selector Dn

encoding used for records in this db. NOTE that String args are not converted according to this encoding, but rather are passed as Java UTF-8, so you better stick to 7 bits.

final int org::openisis::Db::HTA = 0x700000 [static]

field v: 7bit ASCII HTML. HTML-entities and all chars greater than 127 are escaped.

final int org::openisis::Db::HTI = 0x300000 [static]

field v: 8bit ISO-8859-1 HTML. HTML-entities and all chars greater than 255 are escaped.

final int org::openisis::Db::HTU = 0x100000 [static]

field v: 16bit UNICODE HTML. HTML-entities are escaped.

final int org::openisis::Db::LOCC = 0xffff << 16 [static]

rec v: occurence range up to last occ

final int org::openisis::Db::MD = 0x20000 [static]

field v: data flag (no effect w/o heading)

final int org::openisis::Db::MDL = 0x30000 [static]

field v: data mode (includes heading flag)

final int org::openisis::Db::MDU = 0x70000 [static]

field v: uppercase data mode

final int org::openisis::Db::MHL = 0x10000 [static]

field v: heading mode

final int org::openisis::Db::MHU = 0x50000 [static]

field v: uppercase heading mode

final int org::openisis::Db::MI = 0x80000 [static]

field v: index formatting flag

final int org::openisis::Db::MXU = 0x40000 [static]

field v: uppercase mode flag

final int org::openisis::Db::NS = 0x8000000 [static]

rec v: dummy absence selector Nn

final int org::openisis::Db::PP = 0x2000000 [static]

rec v: repeated prefix plus operator (not on 1st occ)

final int org::openisis::Db::PS = 0x1000000 [static]

rec v: repeated suffix plus operator (not on last occ)

final int org::openisis::Db::QRY_KEYAT = 2 [static]

index scan key auto (checks for '$')

final int org::openisis::Db::QRY_KEYEQ = 0 [static]

index scan key equal

final int org::openisis::Db::QRY_KEYPF = 1 [static]

index scan key prefix

final int org::openisis::Db::QRY_PROPER = 129 [static]

query expression with proper binding using precedence, ()

final int org::openisis::Db::QRY_SCANC = 65 [static]

fulltext scan for contains

final int org::openisis::Db::QRY_SCANE = 64 [static]

fulltext scan for equal

final int org::openisis::Db::QRY_SIMPLE = 128 [static]

query expression with simple left-to-right binding


The documentation for this class was generated from the following file:
 All Classes Namespaces Functions Variables

Generated on Tue Mar 30 14:47:17 2010 for IsisReader by  doxygen 1.6.1