|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecttokyocabinet.TDBQRY
public class TDBQRY
Query is a mechanism to search for and retrieve records corresponding conditions from table database.
Field Summary | |
---|---|
static int |
KWMUBRCT
KWIC option: mark up by square brackets |
static int |
KWMUCTRL
KWIC option: mark up by control characters |
static int |
KWMUTAB
KWIC option: mark up by tabs |
static int |
KWNOOVER
KWIC option: do not overlap |
static int |
KWPULEAD
KWIC option: pick up the lead string |
static int |
MSDIFF
set operation type: difference |
static int |
MSISECT
set operation type: intersection |
static int |
MSUNION
set operation type: union |
static int |
QCFTSAND
query condition: full-text search with all tokens in |
static int |
QCFTSEX
query condition: full-text search with the compound expression of |
static int |
QCFTSOR
query condition: full-text search with at least one token in |
static int |
QCFTSPH
query condition: full-text search with the phrase of |
static int |
QCNEGATE
query condition: negation flag |
static int |
QCNOIDX
query condition: no index flag |
static int |
QCNUMBT
query condition: number is between two tokens of |
static int |
QCNUMEQ
query condition: number is equal to |
static int |
QCNUMGE
query condition: number is greater than or equal to |
static int |
QCNUMGT
query condition: number is greater than |
static int |
QCNUMLE
query condition: number is less than or equal to |
static int |
QCNUMLT
query condition: number is less than |
static int |
QCNUMOREQ
query condition: number is equal to at least one token in |
static int |
QCSTRAND
query condition: string includes all tokens in |
static int |
QCSTRBW
query condition: string begins with |
static int |
QCSTREQ
query condition: string is equal to |
static int |
QCSTREW
query condition: string ends with |
static int |
QCSTRINC
query condition: string is included in |
static int |
QCSTROR
query condition: string includes at least one token in |
static int |
QCSTROREQ
query condition: string is equal to at least one token in |
static int |
QCSTRRX
query condition: string matches regular expressions of |
static int |
QONUMASC
order type: number ascending |
static int |
QONUMDESC
order type: number descending |
static int |
QOSTRASC
order type: string ascending |
static int |
QOSTRDESC
order type: string descending |
Constructor Summary | |
---|---|
TDBQRY(TDB tdb)
Create a query object. |
Method Summary | |
---|---|
void |
addcond(java.lang.String name,
int op,
java.lang.String expr)
Add a narrowing condition. |
protected void |
finalize()
Release resources. |
java.lang.String |
hint()
Get the hint of a query object. |
java.lang.String[] |
kwic(java.util.Map cols,
java.lang.String name,
int width,
int opts)
Generate keyword-in-context strings. |
java.util.List |
metasearch(TDBQRY[] others,
int type)
Retrieve records with multiple query objects and get the set of the result. |
boolean |
proc(TDBQRYPROC qp)
Process each corresponding record. |
java.util.List |
search()
Execute the search. |
boolean |
searchout()
Remove each corresponding record. |
void |
setlimit(int max,
int skip)
Set the maximum number of records of the result. |
void |
setorder(java.lang.String name,
int type)
Set the order of the result. |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int KWMUBRCT
public static final int KWMUCTRL
public static final int KWMUTAB
public static final int KWNOOVER
public static final int KWPULEAD
public static final int MSDIFF
public static final int MSISECT
public static final int MSUNION
public static final int QCFTSAND
public static final int QCFTSEX
public static final int QCFTSOR
public static final int QCFTSPH
public static final int QCNEGATE
public static final int QCNOIDX
public static final int QCNUMBT
public static final int QCNUMEQ
public static final int QCNUMGE
public static final int QCNUMGT
public static final int QCNUMLE
public static final int QCNUMLT
public static final int QCNUMOREQ
public static final int QCSTRAND
public static final int QCSTRBW
public static final int QCSTREQ
public static final int QCSTREW
public static final int QCSTRINC
public static final int QCSTROR
public static final int QCSTROREQ
public static final int QCSTRRX
public static final int QONUMASC
public static final int QONUMDESC
public static final int QOSTRASC
public static final int QOSTRDESC
Constructor Detail |
---|
public TDBQRY(TDB tdb)
tdb
- the table database object.Method Detail |
---|
public void addcond(java.lang.String name, int op, java.lang.String expr)
name
- the name of a column. An empty string means the primary key.op
- an operation type: `TDBQRY.QCSTREQ' for string which is equal to the expression,
`TDBQRY.QCSTRINC' for string which is included in the expression, `TDBQRY.QCSTRBW' for
string which begins with the expression, `TDBQRY.QCSTREW' for string which ends with the
expression, `TDBQRY.QCSTRAND' for string which includes all tokens in the expression,
`TDBQRY.QCSTROR' for string which includes at least one token in the expression,
`TDBQRY.QCSTROREQ' for string which is equal to at least one token in the expression,
`TDBQRY.QCSTRRX' for string which matches regular expressions of the expression,
`TDBQRY.QCNUMEQ' for number which is equal to the expression, `TDBQRY.QCNUMGT' for number
which is greater than the expression, `TDBQRY.QCNUMGE' for number which is greater than or
equal to the expression, `TDBQRY.QCNUMLT' for number which is less than the expression,
`TDBQRY.QCNUMLE' for number which is less than or equal to the expression, `TDBQRY.QCNUMBT'
for number which is between two tokens of the expression, `TDBQRY.QCNUMOREQ' for number
which is equal to at least one token in the expression, `TDBQRY.QCFTSPH' for full-text
search with the phrase of the expression, `TDBQRY.QCFTSAND' for full-text search with all
tokens in the expression, `TDBQRY.QCFTSOR' for full-text search with at least one token in
the expression, `TDBQRY.QCFTSEX' for full-text search with the compound expression. All
operations can be flagged by bitwise-or: `TDBQRY.QCNEGATE' for negation, `TDBQRY.QCNOIDX'
for using no index.expr
- an operand exression.protected void finalize()
finalize
in class java.lang.Object
public java.lang.String hint()
public java.lang.String[] kwic(java.util.Map cols, java.lang.String name, int width, int opts)
cols
- a hash containing columns.name
- the name of a column. If it is not defined, the first column of the query is
specified.width
- the width of strings picked up around each keyword. If it is negative, the
whole text is picked up.opts
- options by bitwise-or: `TDBQRY.KWMUTAB' specifies that each keyword is marked up
between two tab characters, `TDBQRY.KWMUCTRL' specifies that each keyword is marked up by
the STX (0x02) code and the ETX (0x03) code, `TDBQRY.KWMUBRCT' specifies that each keyword
is marked up by the two square brackets, `TDBQRY.KWNOOVER' specifies that each context does
not overlap, `TDBQRY.KWPULEAD' specifies that the lead string is picked up forcibly.
public java.util.List metasearch(TDBQRY[] others, int type)
others
- an array of the query objects except for the self object.type
- a set operation type: `TDBQRY.MSUNION' for the union set, `TDBQRY.MSISECT' for
the intersection set, `TDBQRY.MSDIFF' for the difference set. If it is not defined,
`TDBQRY.MSUNION' is specified.
public boolean proc(TDBQRYPROC qp)
qp
- specifies the query processor object.
public java.util.List search()
public boolean searchout()
public void setlimit(int max, int skip)
max
- the maximum number of records of the result. If it is negative, no limit is
specified.skip
- the maximum number of records of the result. If it is not more than 0, no
record is skipped.public void setorder(java.lang.String name, int type)
name
- the name of a column. An empty string means the primary key.type
- the order type: `TDBQRY.QOSTRASC' for string ascending, `TDBQRY.QOSTRDESC' for
string descending, `TDBQRY.QONUMASC' for number ascending, `TDBQRY.QONUMDESC' for number
descending.
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |