From 16e2c3fe05ac63352f545a2938b2daca67441690 Mon Sep 17 00:00:00 2001 From: dsandersoremutah Date: Thu, 17 Aug 2006 22:53:33 +0000 Subject: [PATCH] Added more methods to Query class. git-svn-id: https://svn.code.sf.net/p/flaim/code/trunk@773 0109f412-320b-0410-ab79-c3e0c5ffbbe6 --- xflaim/java/jni/jdbsystem.cpp | 92 +-- xflaim/java/jni/jquery.cpp | 895 +++++++++++++++++++++-- xflaim/java/jni/xflaim_CompareRules.h | 31 + xflaim/java/jni/xflaim_DbSystem.h | 8 +- xflaim/java/jni/xflaim_OptInfo.h | 21 + xflaim/java/jni/xflaim_OptType.h | 23 + xflaim/java/jni/xflaim_Query.h | 172 ++++- xflaim/java/jni/xflaim_QueryOperators.h | 63 ++ xflaim/java/jni/xflaim_ResultSetCounts.h | 21 + xflaim/java/jni/xflaim_SearchFlags.h | 29 + xflaim/java/jni/xflaim_XPathAxis.h | 43 ++ xflaim/java/xflaim/CompareRules.java | 44 ++ xflaim/java/xflaim/DataVector.java | 5 + xflaim/java/xflaim/Db.java | 3 +- xflaim/java/xflaim/DbSystem.java | 49 +- xflaim/java/xflaim/OptInfo.java | 63 ++ xflaim/java/xflaim/OptType.java | 40 + xflaim/java/xflaim/Query.java | 820 +++++++++++++++++---- xflaim/java/xflaim/QueryOperators.java | 60 ++ xflaim/java/xflaim/ResultSetCounts.java | 40 + xflaim/java/xflaim/SearchFlags.java | 43 ++ xflaim/java/xflaim/XPathAxis.java | 50 ++ 22 files changed, 2271 insertions(+), 344 deletions(-) create mode 100644 xflaim/java/jni/xflaim_CompareRules.h create mode 100644 xflaim/java/jni/xflaim_OptInfo.h create mode 100644 xflaim/java/jni/xflaim_OptType.h create mode 100644 xflaim/java/jni/xflaim_QueryOperators.h create mode 100644 xflaim/java/jni/xflaim_ResultSetCounts.h create mode 100644 xflaim/java/jni/xflaim_SearchFlags.h create mode 100644 xflaim/java/jni/xflaim_XPathAxis.h create mode 100644 xflaim/java/xflaim/CompareRules.java create mode 100644 xflaim/java/xflaim/OptInfo.java create mode 100644 xflaim/java/xflaim/OptType.java create mode 100644 xflaim/java/xflaim/QueryOperators.java create mode 100644 xflaim/java/xflaim/ResultSetCounts.java create mode 100644 xflaim/java/xflaim/SearchFlags.java create mode 100644 xflaim/java/xflaim/XPathAxis.java diff --git a/xflaim/java/jni/jdbsystem.cpp b/xflaim/java/jni/jdbsystem.cpp index 399750b..ca95975 100644 --- a/xflaim/java/jni/jdbsystem.cpp +++ b/xflaim/java/jni/jdbsystem.cpp @@ -3480,14 +3480,7 @@ JNIEXPORT jint JNICALL Java_xflaim_DbSystem__1compareStrings( jboolean bLeftWild, jstring sRightString, jboolean bRightWild, - jboolean bCaseInsensitive, - jboolean bCompressWhitespace, - jboolean bNoWhitespace, - jboolean bNoUnderscores, - jboolean bNoDashes, - jboolean bWhitespaceAsSpace, - jboolean bIgnoreLeadingSpace, - jboolean bIgnoreTrailingSpace, + jint iCompareRules, jint iLanguage) { RCODE rc = NE_XFLM_OK; @@ -3495,7 +3488,6 @@ JNIEXPORT jint JNICALL Java_xflaim_DbSystem__1compareStrings( F_DynaBuf leftStringBuf( ucLeftString, sizeof( ucLeftString)); FLMBYTE ucRightString [100]; F_DynaBuf rightStringBuf( ucRightString, sizeof( ucRightString)); - FLMUINT uiCompareRules; FLMINT iResult = 0; // Get the strings. @@ -3511,40 +3503,6 @@ JNIEXPORT jint JNICALL Java_xflaim_DbSystem__1compareStrings( goto Exit; } - uiCompareRules = 0; - if (bCaseInsensitive) - { - uiCompareRules |= XFLM_COMP_CASE_INSENSITIVE; - } - if (bCompressWhitespace) - { - uiCompareRules |= XFLM_COMP_COMPRESS_WHITESPACE; - } - if (bNoWhitespace) - { - uiCompareRules |= XFLM_COMP_NO_WHITESPACE; - } - if (bNoUnderscores) - { - uiCompareRules |= XFLM_COMP_NO_UNDERSCORES; - } - if (bNoDashes) - { - uiCompareRules |= XFLM_COMP_NO_DASHES; - } - if (bWhitespaceAsSpace) - { - uiCompareRules |= XFLM_COMP_WHITESPACE_AS_SPACE; - } - if (bIgnoreLeadingSpace) - { - uiCompareRules |= XFLM_COMP_IGNORE_LEADING_SPACE; - } - if (bIgnoreTrailingSpace) - { - uiCompareRules |= XFLM_COMP_IGNORE_TRAILING_SPACE; - } - if (RC_BAD( rc = THIS_DBSYS()->compareUTF8Strings( (const FLMBYTE *)leftStringBuf.getBufferPtr(), leftStringBuf.getDataLength() - 1, @@ -3552,7 +3510,7 @@ JNIEXPORT jint JNICALL Java_xflaim_DbSystem__1compareStrings( (const FLMBYTE *)rightStringBuf.getBufferPtr(), rightStringBuf.getDataLength() - 1, bRightWild ? TRUE : FALSE, - uiCompareRules, (FLMUINT)iLanguage, &iResult))) + (FLMUINT)iCompareRules, (FLMUINT)iLanguage, &iResult))) { ThrowError( rc, pEnv); goto Exit; @@ -3572,14 +3530,7 @@ JNIEXPORT jboolean JNICALL Java_xflaim_DbSystem__1hasSubStr( jlong lThis, jstring sString, jstring sSubString, - jboolean bCaseInsensitive, - jboolean bCompressWhitespace, - jboolean bNoWhitespace, - jboolean bNoUnderscores, - jboolean bNoDashes, - jboolean bWhitespaceAsSpace, - jboolean bIgnoreLeadingSpace, - jboolean bIgnoreTrailingSpace, + jint iCompareRules, jint iLanguage) { RCODE rc = NE_XFLM_OK; @@ -3587,7 +3538,6 @@ JNIEXPORT jboolean JNICALL Java_xflaim_DbSystem__1hasSubStr( F_DynaBuf stringBuf( ucString, sizeof( ucString)); FLMBYTE ucSubString [100]; F_DynaBuf subStringBuf( ucSubString, sizeof( ucSubString)); - FLMUINT uiCompareRules; FLMBOOL bExists = FALSE; // Get the strings. @@ -3603,44 +3553,10 @@ JNIEXPORT jboolean JNICALL Java_xflaim_DbSystem__1hasSubStr( goto Exit; } - uiCompareRules = 0; - if (bCaseInsensitive) - { - uiCompareRules |= XFLM_COMP_CASE_INSENSITIVE; - } - if (bCompressWhitespace) - { - uiCompareRules |= XFLM_COMP_COMPRESS_WHITESPACE; - } - if (bNoWhitespace) - { - uiCompareRules |= XFLM_COMP_NO_WHITESPACE; - } - if (bNoUnderscores) - { - uiCompareRules |= XFLM_COMP_NO_UNDERSCORES; - } - if (bNoDashes) - { - uiCompareRules |= XFLM_COMP_NO_DASHES; - } - if (bWhitespaceAsSpace) - { - uiCompareRules |= XFLM_COMP_WHITESPACE_AS_SPACE; - } - if (bIgnoreLeadingSpace) - { - uiCompareRules |= XFLM_COMP_IGNORE_LEADING_SPACE; - } - if (bIgnoreTrailingSpace) - { - uiCompareRules |= XFLM_COMP_IGNORE_TRAILING_SPACE; - } - if (RC_BAD( rc = THIS_DBSYS()->utf8IsSubStr( (const FLMBYTE *)stringBuf.getBufferPtr(), (const FLMBYTE *)subStringBuf.getBufferPtr(), - uiCompareRules, (FLMUINT)iLanguage, &bExists))) + (FLMUINT)iCompareRules, (FLMUINT)iLanguage, &bExists))) { ThrowError( rc, pEnv); goto Exit; diff --git a/xflaim/java/jni/jquery.cpp b/xflaim/java/jni/jquery.cpp index 296904a..592cc96 100644 --- a/xflaim/java/jni/jquery.cpp +++ b/xflaim/java/jni/jquery.cpp @@ -24,11 +24,199 @@ //------------------------------------------------------------------------------ #include "xflaim_Query.h" +#include "xflaim_OptInfo.h" +#include "xflaim_ResultSetCounts.h" #include "flaimsys.h" #include "jniftk.h" #define THIS_QUERY() ((F_Query *)((FLMUINT)lThis)) + +// Fields in the OptInfo class +static jfieldID fid_OptInfo_iOptType = NULL; +static jfieldID fid_OptInfo_iCost = NULL; +static jfieldID fid_OptInfo_lNodeId = NULL; +static jfieldID fid_OptInfo_lEndNodeId = NULL; +static jfieldID fid_OptInfo_iIxNum = NULL; +static jfieldID fid_OptInfo_sIxName = NULL; +static jfieldID fid_OptInfo_bMustVerifyPath = NULL; +static jfieldID fid_OptInfo_bDoNodeMatch = NULL; +static jfieldID fid_OptInfo_bCanCompareOnKey = NULL; +static jfieldID fid_OptInfo_lKeysRead = NULL; +static jfieldID fid_OptInfo_lKeyHadDupDoc = NULL; +static jfieldID fid_OptInfo_lKeysPassed = NULL; +static jfieldID fid_OptInfo_lNodesRead = NULL; +static jfieldID fid_OptInfo_lNodesTested = NULL; +static jfieldID fid_OptInfo_lNodesPassed = NULL; +static jfieldID fid_OptInfo_lDocsRead = NULL; +static jfieldID fid_OptInfo_lDupDocsEliminated = NULL; +static jfieldID fid_OptInfo_lNodesFailedValidation = NULL; +static jfieldID fid_OptInfo_lDocsFailedValidation = NULL; +static jfieldID fid_OptInfo_lDocsPassed = NULL; + +// Fields in the ResultSetCounts class + +static jfieldID fid_ResultSetCounts_iReadCount = NULL; +static jfieldID fid_ResultSetCounts_iPassedCount = NULL; +static jfieldID fid_ResultSetCounts_iPositionableToCount = NULL; +static jfieldID fid_ResultSetCounts_bDoneBuildingResultSet = NULL; + +FSTATIC jobject NewOptInfo( + JNIEnv * pEnv, + XFLM_OPT_INFO * pOptInfo, + jclass jOptInfoClass); + +/**************************************************************************** +Desc: +****************************************************************************/ +JNIEXPORT void JNICALL Java_xflaim_OptInfo_initIDs( + JNIEnv * pEnv, + jclass jOptInfoClass) +{ + + // Get the field IDs for the fields in the class. + + if ((fid_OptInfo_iOptType = pEnv->GetFieldID( jOptInfoClass, + "iOptType", "I")) == NULL) + { + goto Exit; + } + if ((fid_OptInfo_iCost = pEnv->GetFieldID( jOptInfoClass, + "iCost", "I")) == NULL) + { + goto Exit; + } + if ((fid_OptInfo_lNodeId = pEnv->GetFieldID( jOptInfoClass, + "lNodeId", "J")) == NULL) + { + goto Exit; + } + if ((fid_OptInfo_lEndNodeId = pEnv->GetFieldID( jOptInfoClass, + "lEndNodeId", "J")) == NULL) + { + goto Exit; + } + if ((fid_OptInfo_iIxNum = pEnv->GetFieldID( jOptInfoClass, + "iIxNum", "I")) == NULL) + { + goto Exit; + } + if ((fid_OptInfo_sIxName = pEnv->GetFieldID( jOptInfoClass, + "sIxName", "Ljava/lang/String;")) == NULL) + { + goto Exit; + } + if ((fid_OptInfo_bMustVerifyPath = pEnv->GetFieldID( jOptInfoClass, + "bMustVerifyPath", "Z")) == NULL) + { + goto Exit; + } + if ((fid_OptInfo_bDoNodeMatch = pEnv->GetFieldID( jOptInfoClass, + "bDoNodeMatch", "Z")) == NULL) + { + goto Exit; + } + if ((fid_OptInfo_bCanCompareOnKey = pEnv->GetFieldID( jOptInfoClass, + "bCanCompareOnKey", "Z")) == NULL) + { + goto Exit; + } + if ((fid_OptInfo_lKeysRead = pEnv->GetFieldID( jOptInfoClass, + "lKeysRead", "J")) == NULL) + { + goto Exit; + } + if ((fid_OptInfo_lKeyHadDupDoc = pEnv->GetFieldID( jOptInfoClass, + "lKeyHadDupDoc", "J")) == NULL) + { + goto Exit; + } + if ((fid_OptInfo_lKeysPassed = pEnv->GetFieldID( jOptInfoClass, + "lKeysPassed", "J")) == NULL) + { + goto Exit; + } + if ((fid_OptInfo_lNodesRead = pEnv->GetFieldID( jOptInfoClass, + "lNodesRead", "J")) == NULL) + { + goto Exit; + } + if ((fid_OptInfo_lNodesTested = pEnv->GetFieldID( jOptInfoClass, + "lNodesTested", "J")) == NULL) + { + goto Exit; + } + if ((fid_OptInfo_lNodesPassed = pEnv->GetFieldID( jOptInfoClass, + "lNodesPassed", "J")) == NULL) + { + goto Exit; + } + if ((fid_OptInfo_lDocsRead = pEnv->GetFieldID( jOptInfoClass, + "lDocsRead", "J")) == NULL) + { + goto Exit; + } + if ((fid_OptInfo_lDupDocsEliminated = pEnv->GetFieldID( jOptInfoClass, + "lDupDocsEliminated", "J")) == NULL) + { + goto Exit; + } + if ((fid_OptInfo_lNodesFailedValidation = pEnv->GetFieldID( jOptInfoClass, + "lNodesFailedValidation", "J")) == NULL) + { + goto Exit; + } + if ((fid_OptInfo_lDocsFailedValidation = pEnv->GetFieldID( jOptInfoClass, + "lDocsFailedValidation", "J")) == NULL) + { + goto Exit; + } + if ((fid_OptInfo_lDocsPassed = pEnv->GetFieldID( jOptInfoClass, + "lDocsPassed", "J")) == NULL) + { + goto Exit; + } + +Exit: + + return; +} + +/**************************************************************************** +Desc: +****************************************************************************/ +JNIEXPORT void JNICALL Java_xflaim_ResultSetCounts_initIDs( + JNIEnv * pEnv, + jclass jResultSetCountsClass) +{ + + // Get the field IDs for the fields in the class. + + if ((fid_ResultSetCounts_iReadCount = pEnv->GetFieldID( jResultSetCountsClass, + "iReadCount", "I")) == NULL) + { + goto Exit; + } + if ((fid_ResultSetCounts_iPassedCount = pEnv->GetFieldID( jResultSetCountsClass, + "iPassedCount", "I")) == NULL) + { + goto Exit; + } + if ((fid_ResultSetCounts_iPositionableToCount = pEnv->GetFieldID( jResultSetCountsClass, + "iPositionableToCount", "I")) == NULL) + { + goto Exit; + } + if ((fid_ResultSetCounts_bDoneBuildingResultSet = pEnv->GetFieldID( jResultSetCountsClass, + "bDoneBuildingResultSet", "Z")) == NULL) + { + goto Exit; + } + +Exit: + + return; +} /**************************************************************************** Desc: ****************************************************************************/ @@ -180,80 +368,17 @@ Exit: Desc: ****************************************************************************/ JNIEXPORT void JNICALL Java_xflaim_Query__1addOperator( - JNIEnv * pEnv, - jobject, // obj - jlong lThis, - jint iOperator) -{ - RCODE rc = NE_XFLM_OK; - IF_Query * pQuery = THIS_QUERY(); - - if (RC_BAD( rc = pQuery->addOperator( (eQueryOperators)iOperator, 0, NULL))) - { - ThrowError( rc, pEnv); - goto Exit; - } - -Exit: - - return; -} - -/**************************************************************************** -Desc: -****************************************************************************/ -JNIEXPORT void JNICALL Java_xflaim_Query__1addStringOperator( JNIEnv * pEnv, jobject, // obj jlong lThis, jint iOperator, - jboolean bCaseInsensitive, - jboolean bCompressWhitespace, - jboolean bNoWhitespace, - jboolean bNoUnderscores, - jboolean bNoDashes, - jboolean bWhitespaceAsSpace, - jboolean bIgnoreLeadingSpace, - jboolean bIgnoreTrailingSpace) + jint iCompareRules) { RCODE rc = NE_XFLM_OK; IF_Query * pQuery = THIS_QUERY(); - FLMUINT uiCompareRules = 0; - if (bCaseInsensitive) - { - uiCompareRules |= XFLM_COMP_CASE_INSENSITIVE; - } - if (bCompressWhitespace) - { - uiCompareRules |= XFLM_COMP_COMPRESS_WHITESPACE; - } - if (bNoWhitespace) - { - uiCompareRules |= XFLM_COMP_NO_WHITESPACE; - } - if (bNoUnderscores) - { - uiCompareRules |= XFLM_COMP_NO_UNDERSCORES; - } - if (bNoDashes) - { - uiCompareRules |= XFLM_COMP_NO_DASHES; - } - if (bWhitespaceAsSpace) - { - uiCompareRules |= XFLM_COMP_WHITESPACE_AS_SPACE; - } - if (bIgnoreLeadingSpace) - { - uiCompareRules |= XFLM_COMP_IGNORE_LEADING_SPACE; - } - if (bIgnoreTrailingSpace) - { - uiCompareRules |= XFLM_COMP_IGNORE_TRAILING_SPACE; - } if (RC_BAD( rc = pQuery->addOperator( (eQueryOperators)iOperator, - uiCompareRules, NULL))) + (FLMUINT)iCompareRules, NULL))) { ThrowError( rc, pEnv); goto Exit; @@ -381,3 +506,643 @@ Exit: return; } +/**************************************************************************** +Desc: +****************************************************************************/ +JNIEXPORT jlong JNICALL Java_xflaim_Query__1getFirst( + JNIEnv * pEnv, + jobject, // obj + jlong lThis, + jlong lDbRef, + jlong lReusedNodeRef, + jint iTimeLimit) +{ + RCODE rc = NE_XFLM_OK; + IF_Query * pQuery = THIS_QUERY(); + IF_Db * pDb = (IF_Db *)((FLMUINT)lDbRef); + IF_DOMNode * pNewNode = lReusedNodeRef + ? (IF_DOMNode *)((FLMUINT)lReusedNodeRef) + : NULL; + + if (RC_BAD( rc = pQuery->getFirst( pDb, &pNewNode, (FLMUINT)iTimeLimit))) + { + ThrowError( rc, pEnv); + goto Exit; + } + +Exit: + + return( (jlong)((FLMUINT)pNewNode)); +} + +/**************************************************************************** +Desc: +****************************************************************************/ +JNIEXPORT jlong JNICALL Java_xflaim_Query__1getLast( + JNIEnv * pEnv, + jobject, // obj + jlong lThis, + jlong lDbRef, + jlong lReusedNodeRef, + jint iTimeLimit) +{ + RCODE rc = NE_XFLM_OK; + IF_Query * pQuery = THIS_QUERY(); + IF_Db * pDb = (IF_Db *)((FLMUINT)lDbRef); + IF_DOMNode * pNewNode = lReusedNodeRef + ? (IF_DOMNode *)((FLMUINT)lReusedNodeRef) + : NULL; + + if (RC_BAD( rc = pQuery->getLast( pDb, &pNewNode, (FLMUINT)iTimeLimit))) + { + ThrowError( rc, pEnv); + goto Exit; + } + +Exit: + + return( (jlong)((FLMUINT)pNewNode)); +} + +/**************************************************************************** +Desc: +****************************************************************************/ +JNIEXPORT jlong JNICALL Java_xflaim_Query__1getNext( + JNIEnv * pEnv, + jobject, // obj + jlong lThis, + jlong lDbRef, + jlong lReusedNodeRef, + jint iTimeLimit, + jint iNumToSkip) +{ + RCODE rc = NE_XFLM_OK; + IF_Query * pQuery = THIS_QUERY(); + IF_Db * pDb = (IF_Db *)((FLMUINT)lDbRef); + IF_DOMNode * pNewNode = lReusedNodeRef + ? (IF_DOMNode *)((FLMUINT)lReusedNodeRef) + : NULL; + + if (RC_BAD( rc = pQuery->getNext( pDb, &pNewNode, (FLMUINT)iTimeLimit, + (FLMUINT)iNumToSkip, NULL))) + { + ThrowError( rc, pEnv); + goto Exit; + } + +Exit: + + return( (jlong)((FLMUINT)pNewNode)); +} + +/**************************************************************************** +Desc: +****************************************************************************/ +JNIEXPORT jlong JNICALL Java_xflaim_Query__1getPrev( + JNIEnv * pEnv, + jobject, // obj + jlong lThis, + jlong lDbRef, + jlong lReusedNodeRef, + jint iTimeLimit, + jint iNumToSkip) +{ + RCODE rc = NE_XFLM_OK; + IF_Query * pQuery = THIS_QUERY(); + IF_Db * pDb = (IF_Db *)((FLMUINT)lDbRef); + IF_DOMNode * pNewNode = lReusedNodeRef + ? (IF_DOMNode *)((FLMUINT)lReusedNodeRef) + : NULL; + + if (RC_BAD( rc = pQuery->getPrev( pDb, &pNewNode, (FLMUINT)iTimeLimit, + (FLMUINT)iNumToSkip, NULL))) + { + ThrowError( rc, pEnv); + goto Exit; + } + +Exit: + + return( (jlong)((FLMUINT)pNewNode)); +} + +/**************************************************************************** +Desc: +****************************************************************************/ +JNIEXPORT jlong JNICALL Java_xflaim_Query__1getCurrent( + JNIEnv * pEnv, + jobject, // obj + jlong lThis, + jlong lDbRef, + jlong lReusedNodeRef) +{ + RCODE rc = NE_XFLM_OK; + IF_Query * pQuery = THIS_QUERY(); + IF_Db * pDb = (IF_Db *)((FLMUINT)lDbRef); + IF_DOMNode * pNewNode = lReusedNodeRef + ? (IF_DOMNode *)((FLMUINT)lReusedNodeRef) + : NULL; + + if (RC_BAD( rc = pQuery->getCurrent( pDb, &pNewNode))) + { + ThrowError( rc, pEnv); + goto Exit; + } + +Exit: + + return( (jlong)((FLMUINT)pNewNode)); +} + +/**************************************************************************** +Desc: +****************************************************************************/ +JNIEXPORT void JNICALL Java_xflaim_Query__1resetQuery( + JNIEnv *, // pEnv, + jobject, // obj + jlong lThis) +{ + THIS_QUERY()->resetQuery(); +} + +/**************************************************************************** +Desc: +****************************************************************************/ +FSTATIC jobject NewOptInfo( + JNIEnv * pEnv, + XFLM_OPT_INFO * pOptInfo, + jclass jOptInfoClass) +{ + jobject jOptInfo = NULL; + jstring jIxName; + + if ((jIxName = pEnv->NewStringUTF( (const char *)pOptInfo->szIxName)) == NULL) + { + goto Exit; + } + + // Allocate and populate the opt info object + + if ((jOptInfo = pEnv->AllocObject( jOptInfoClass)) == NULL) + { + goto Exit; + } + pEnv->SetIntField( jOptInfo, fid_OptInfo_iOptType, + (jint)pOptInfo->eOptType); + pEnv->SetIntField( jOptInfo, fid_OptInfo_iCost, + (jint)pOptInfo->uiCost); + pEnv->SetLongField( jOptInfo, fid_OptInfo_lNodeId, + (jlong)pOptInfo->ui64NodeId); + pEnv->SetLongField( jOptInfo, fid_OptInfo_lEndNodeId, + (jlong)pOptInfo->ui64EndNodeId); + pEnv->SetIntField( jOptInfo, fid_OptInfo_iIxNum, + (jint)pOptInfo->uiIxNum); + pEnv->SetObjectField( jOptInfo, fid_OptInfo_sIxName, + jIxName); + pEnv->SetBooleanField( jOptInfo, fid_OptInfo_bMustVerifyPath, + (jboolean)(pOptInfo->bMustVerifyPath ? JNI_TRUE : JNI_FALSE)); + pEnv->SetBooleanField( jOptInfo, fid_OptInfo_bDoNodeMatch, + (jboolean)(pOptInfo->bDoNodeMatch ? JNI_TRUE : JNI_FALSE)); + pEnv->SetBooleanField( jOptInfo, fid_OptInfo_bCanCompareOnKey, + (jboolean)(pOptInfo->bCanCompareOnKey ? JNI_TRUE : JNI_FALSE)); + pEnv->SetLongField( jOptInfo, fid_OptInfo_lKeysRead, + (jlong)pOptInfo->ui64KeysRead); + pEnv->SetLongField( jOptInfo, fid_OptInfo_lKeyHadDupDoc, + (jlong)pOptInfo->ui64KeyHadDupDoc); + pEnv->SetLongField( jOptInfo, fid_OptInfo_lKeysPassed, + (jlong)pOptInfo->ui64KeysPassed); + pEnv->SetLongField( jOptInfo, fid_OptInfo_lNodesRead, + (jlong)pOptInfo->ui64NodesRead); + pEnv->SetLongField( jOptInfo, fid_OptInfo_lNodesTested, + (jlong)pOptInfo->ui64NodesTested); + pEnv->SetLongField( jOptInfo, fid_OptInfo_lNodesPassed, + (jlong)pOptInfo->ui64NodesPassed); + pEnv->SetLongField( jOptInfo, fid_OptInfo_lDocsRead, + (jlong)pOptInfo->ui64DocsRead); + pEnv->SetLongField( jOptInfo, fid_OptInfo_lDupDocsEliminated, + (jlong)pOptInfo->ui64DupDocsEliminated); + pEnv->SetLongField( jOptInfo, fid_OptInfo_lNodesFailedValidation, + (jlong)pOptInfo->ui64NodesFailedValidation); + pEnv->SetLongField( jOptInfo, fid_OptInfo_lDocsFailedValidation, + (jlong)pOptInfo->ui64DocsFailedValidation); + pEnv->SetLongField( jOptInfo, fid_OptInfo_lDocsPassed, + (jlong)pOptInfo->ui64DocsPassed); + +Exit: + + return( jOptInfo); +} + +/**************************************************************************** +Desc: +****************************************************************************/ +JNIEXPORT jobjectArray JNICALL Java_xflaim_Query__1getStatsAndOptInfo( + JNIEnv * pEnv, + jobject, // obj + jlong lThis) +{ + RCODE rc = NE_XFLM_OK; + IF_Query * pQuery = THIS_QUERY(); + XFLM_OPT_INFO * pOptInfoArray = NULL; + FLMUINT uiNumOptInfos = 0; + jclass jOptInfoClass = NULL; + jobjectArray jOptInfoArray = NULL; + + if (RC_BAD( rc = pQuery->getStatsAndOptInfo( &uiNumOptInfos, &pOptInfoArray))) + { + ThrowError( rc, pEnv); + goto Exit; + } + + // Get the OptInfo class. + + if ((jOptInfoClass = pEnv->FindClass( "xflaim/OptInfo")) == NULL) + { + goto Exit; + } + + // Allocate an array of OptInfo objects. + + if (uiNumOptInfos) + { + XFLM_OPT_INFO * pOptInfo; + FLMUINT uiLoop; + jobject jOptInfo; + + if ((jOptInfoArray = pEnv->NewObjectArray( (jsize)uiNumOptInfos, + jOptInfoClass, NULL)) == NULL) + { + goto Exit; + } + + // Populate the OptInfo array + + for (uiLoop = 0, pOptInfo = pOptInfoArray; + uiLoop < uiNumOptInfos; + uiLoop++, pOptInfo++) + { + + // Allocate an opt info object. + + if ((jOptInfo = NewOptInfo( pEnv, pOptInfo, jOptInfoClass)) == NULL) + { + goto Exit; + } + + // Put the opt info object into the array of + // opt info objects. + + pEnv->SetObjectArrayElement( jOptInfoArray, (jsize)uiLoop, jOptInfo); + } + } + +Exit: + + if (pOptInfoArray) + { + pQuery->freeStatsAndOptInfo( &pOptInfoArray); + } + + return( jOptInfoArray); +} + +/**************************************************************************** +Desc: +****************************************************************************/ +JNIEXPORT void JNICALL Java_xflaim_Query__1setDupHandling( + JNIEnv *, // pEnv, + jobject, // obj + jlong lThis, + jboolean bRemoveDups) +{ + THIS_QUERY()->setDupHandling( bRemoveDups ? TRUE : FALSE); +} + +/**************************************************************************** +Desc: +****************************************************************************/ +JNIEXPORT void JNICALL Java_xflaim_Query__1setIndex( + JNIEnv * pEnv, + jobject, // obj + jlong lThis, + jint iIndex) +{ + RCODE rc = NE_XFLM_OK; + IF_Query * pQuery = THIS_QUERY(); + + if (RC_BAD( rc = pQuery->setIndex( (FLMUINT)iIndex))) + { + ThrowError( rc, pEnv); + goto Exit; + } + +Exit: + + return; +} + +/**************************************************************************** +Desc: +****************************************************************************/ +JNIEXPORT jint JNICALL Java_xflaim_Query__1getIndex( + JNIEnv * pEnv, + jobject, // obj + jlong lThis, + jlong lDbRef) +{ + RCODE rc = NE_XFLM_OK; + IF_Query * pQuery = THIS_QUERY(); + IF_Db * pDb = (IF_Db *)((FLMUINT)lDbRef); + FLMUINT uiIndex; + FLMBOOL bHaveMultiple; + + if (RC_BAD( rc = pQuery->getIndex( pDb, &uiIndex, &bHaveMultiple))) + { + ThrowError( rc, pEnv); + goto Exit; + } + +Exit: + + return( (jint)uiIndex); +} + +/**************************************************************************** +Desc: +****************************************************************************/ +JNIEXPORT jboolean JNICALL Java_xflaim_Query__1usesMultipleIndexes( + JNIEnv * pEnv, + jobject, // obj + jlong lThis, + jlong lDbRef) +{ + RCODE rc = NE_XFLM_OK; + IF_Query * pQuery = THIS_QUERY(); + IF_Db * pDb = (IF_Db *)((FLMUINT)lDbRef); + FLMUINT uiIndex; + FLMBOOL bHaveMultiple; + + if (RC_BAD( rc = pQuery->getIndex( pDb, &uiIndex, &bHaveMultiple))) + { + ThrowError( rc, pEnv); + goto Exit; + } + +Exit: + + return( (jboolean)(bHaveMultiple ? JNI_TRUE : JNI_FALSE)); +} + +/**************************************************************************** +Desc: +****************************************************************************/ +JNIEXPORT jlong JNICALL Java_xflaim_Query__1addSortKey( + JNIEnv * pEnv, + jobject, // obj + jlong lThis, + jlong lSortKeyContext, + jboolean bChildToContext, + jboolean bElement, + jint iNameId, + jint iCompareRules, + jint iLimit, + jint iKeyComponent, + jboolean bSortDescending, + jboolean bSortMissingHigh) +{ + RCODE rc = NE_XFLM_OK; + IF_Query * pQuery = THIS_QUERY(); + void * pvContext = (void *)((FLMUINT)lSortKeyContext); + void * pvReturnedContext = NULL; + + if (RC_BAD( rc = pQuery->addSortKey( pvContext, + (FLMBOOL)(bChildToContext ? TRUE : FALSE), + (FLMBOOL)(bElement ? TRUE : FALSE), + (FLMUINT)iNameId, + (FLMUINT)iCompareRules, + (FLMUINT)iLimit, + (FLMUINT)iKeyComponent, + (FLMBOOL)(bSortDescending ? TRUE : FALSE), + (FLMBOOL)(bSortMissingHigh ? TRUE : FALSE), + &pvReturnedContext))) + { + ThrowError( rc, pEnv); + goto Exit; + } + +Exit: + + return( (jlong)((FLMUINT)pvReturnedContext)); +} + +/**************************************************************************** +Desc: +****************************************************************************/ +JNIEXPORT void JNICALL Java_xflaim_Query__1enablePositioning( + JNIEnv * pEnv, + jobject, // obj + jlong lThis) +{ + RCODE rc = NE_XFLM_OK; + IF_Query * pQuery = THIS_QUERY(); + + if (RC_BAD( rc = pQuery->enablePositioning())) + { + ThrowError( rc, pEnv); + goto Exit; + } + +Exit: + + return; +} + +/**************************************************************************** +Desc: +****************************************************************************/ +JNIEXPORT jlong JNICALL Java_xflaim_Query__1positionTo( + JNIEnv * pEnv, + jobject, // obj + jlong lThis, + jlong lDbRef, + jlong lReusedNodeRef, + jint iTimeLimit, + jint iPosition) +{ + RCODE rc = NE_XFLM_OK; + IF_Query * pQuery = THIS_QUERY(); + IF_Db * pDb = (IF_Db *)((FLMUINT)lDbRef); + IF_DOMNode * pNewNode = lReusedNodeRef + ? (IF_DOMNode *)((FLMUINT)lReusedNodeRef) + : NULL; + + if (RC_BAD( rc = pQuery->positionTo( pDb, &pNewNode, (FLMUINT)iTimeLimit, + (FLMUINT)iPosition))) + { + ThrowError( rc, pEnv); + goto Exit; + } + +Exit: + + return( (jlong)((FLMUINT)pNewNode)); +} + +/**************************************************************************** +Desc: +****************************************************************************/ +JNIEXPORT jlong JNICALL Java_xflaim_Query__1positionTo2( + JNIEnv * pEnv, + jobject, // obj + jlong lThis, + jlong lDbRef, + jlong lReusedNodeRef, + jint iTimeLimit, + jlong lSearchKeyRef, + jint iFlags) +{ + RCODE rc = NE_XFLM_OK; + IF_Query * pQuery = THIS_QUERY(); + IF_Db * pDb = (IF_Db *)((FLMUINT)lDbRef); + IF_DataVector * pSearchKey = (IF_DataVector *)((FLMUINT)lSearchKeyRef); + IF_DOMNode * pNewNode = lReusedNodeRef + ? (IF_DOMNode *)((FLMUINT)lReusedNodeRef) + : NULL; + + if (RC_BAD( rc = pQuery->positionTo( pDb, &pNewNode, (FLMUINT)iTimeLimit, + pSearchKey, (FLMUINT)iFlags))) + { + ThrowError( rc, pEnv); + goto Exit; + } + +Exit: + + return( (jlong)((FLMUINT)pNewNode)); +} + +/**************************************************************************** +Desc: +****************************************************************************/ +JNIEXPORT jint JNICALL Java_xflaim_Query__1getPosition( + JNIEnv * pEnv, + jobject, // obj + jlong lThis, + jlong lDbRef) +{ + RCODE rc = NE_XFLM_OK; + IF_Query * pQuery = THIS_QUERY(); + IF_Db * pDb = (IF_Db *)((FLMUINT)lDbRef); + FLMUINT uiPosition = 0; + + if (RC_BAD( rc = pQuery->getPosition( pDb, &uiPosition))) + { + ThrowError( rc, pEnv); + goto Exit; + } + +Exit: + + return( (jint)uiPosition); +} + +/**************************************************************************** +Desc: +****************************************************************************/ +JNIEXPORT void JNICALL Java_xflaim_Query__1buildResultSet( + JNIEnv * pEnv, + jobject, // obj + jlong lThis, + jlong lDbRef, + jint iTimeLimit) +{ + RCODE rc = NE_XFLM_OK; + IF_Query * pQuery = THIS_QUERY(); + IF_Db * pDb = (IF_Db *)((FLMUINT)lDbRef); + + if (RC_BAD( rc = pQuery->buildResultSet( pDb, (FLMUINT)iTimeLimit))) + { + ThrowError( rc, pEnv); + goto Exit; + } + +Exit: + + return; +} + +/**************************************************************************** +Desc: +****************************************************************************/ +JNIEXPORT void JNICALL Java_xflaim_Query__1stopBuildingResultSet( + JNIEnv *, // pEnv, + jobject, // obj + jlong lThis) +{ + THIS_QUERY()->stopBuildingResultSet(); +} + +/**************************************************************************** +Desc: +****************************************************************************/ +JNIEXPORT void JNICALL Java_xflaim_Query__1enableResultSetEncryption( + JNIEnv *, // pEnv, + jobject, // obj + jlong lThis) +{ + THIS_QUERY()->enableResultSetEncryption(); +} + +/**************************************************************************** +Desc: +****************************************************************************/ +JNIEXPORT jobject JNICALL Java_xflaim_Query__1getResultSetCounts( + JNIEnv * pEnv, + jobject, // obj + jlong lThis, + jlong lDbRef, + jint iTimeLimit, + jboolean bPartialCountOk) +{ + RCODE rc = NE_XFLM_OK; + IF_Query * pQuery = THIS_QUERY(); + IF_Db * pDb = (IF_Db *)((FLMUINT)lDbRef); + jclass jResultSetCountsClass = NULL; + jobject jCounts = NULL; + FLMUINT uiReadCount; + FLMUINT uiPassedCount; + FLMUINT uiPositionableToCount; + FLMBOOL bDoneBuildingResultSet; + + if (RC_BAD( rc = pQuery->getCounts( pDb, (FLMUINT)iTimeLimit, + (FLMBOOL)(bPartialCountOk ? TRUE : FALSE), + &uiReadCount, &uiPassedCount, + &uiPositionableToCount, &bDoneBuildingResultSet))) + { + ThrowError( rc, pEnv); + goto Exit; + } + + if ((jResultSetCountsClass = pEnv->FindClass( "xflaim/ResultSetCounts")) == NULL) + { + goto Exit; + } + + if ((jCounts = pEnv->AllocObject( jResultSetCountsClass)) == NULL) + { + goto Exit; + } + pEnv->SetIntField( jCounts, fid_ResultSetCounts_iReadCount, + (jint)uiReadCount); + pEnv->SetIntField( jCounts, fid_ResultSetCounts_iPassedCount, + (jint)uiPassedCount); + pEnv->SetIntField( jCounts, fid_ResultSetCounts_iPositionableToCount, + (jint)uiPositionableToCount); + pEnv->SetBooleanField( jCounts, fid_ResultSetCounts_bDoneBuildingResultSet, + (jboolean)(bDoneBuildingResultSet ? JNI_TRUE : JNI_FALSE)); + +Exit: + + return( jCounts); +} + diff --git a/xflaim/java/jni/xflaim_CompareRules.h b/xflaim/java/jni/xflaim_CompareRules.h new file mode 100644 index 0000000..4ff42f3 --- /dev/null +++ b/xflaim/java/jni/xflaim_CompareRules.h @@ -0,0 +1,31 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class xflaim_CompareRules */ + +#ifndef _Included_xflaim_CompareRules +#define _Included_xflaim_CompareRules +#ifdef __cplusplus +extern "C" { +#endif +#undef xflaim_CompareRules_FLM_COMP_CASE_INSENSITIVE +#define xflaim_CompareRules_FLM_COMP_CASE_INSENSITIVE 1L +#undef xflaim_CompareRules_FLM_COMP_COMPRESS_WHITESPACE +#define xflaim_CompareRules_FLM_COMP_COMPRESS_WHITESPACE 2L +#undef xflaim_CompareRules_FLM_COMP_NO_WHITESPACE +#define xflaim_CompareRules_FLM_COMP_NO_WHITESPACE 4L +#undef xflaim_CompareRules_FLM_COMP_NO_UNDERSCORES +#define xflaim_CompareRules_FLM_COMP_NO_UNDERSCORES 8L +#undef xflaim_CompareRules_FLM_COMP_NO_DASHES +#define xflaim_CompareRules_FLM_COMP_NO_DASHES 16L +#undef xflaim_CompareRules_FLM_COMP_WHITESPACE_AS_SPACE +#define xflaim_CompareRules_FLM_COMP_WHITESPACE_AS_SPACE 32L +#undef xflaim_CompareRules_FLM_COMP_IGNORE_LEADING_SPACE +#define xflaim_CompareRules_FLM_COMP_IGNORE_LEADING_SPACE 64L +#undef xflaim_CompareRules_FLM_COMP_IGNORE_TRAILING_SPACE +#define xflaim_CompareRules_FLM_COMP_IGNORE_TRAILING_SPACE 128L +#undef xflaim_CompareRules_FLM_COMP_WILD +#define xflaim_CompareRules_FLM_COMP_WILD 256L +#ifdef __cplusplus +} +#endif +#endif diff --git a/xflaim/java/jni/xflaim_DbSystem.h b/xflaim/java/jni/xflaim_DbSystem.h index 23ee08d..b294c60 100644 --- a/xflaim/java/jni/xflaim_DbSystem.h +++ b/xflaim/java/jni/xflaim_DbSystem.h @@ -458,18 +458,18 @@ JNIEXPORT jint JNICALL Java_xflaim_DbSystem__1getLowDirtyCacheLimit /* * Class: xflaim_DbSystem * Method: _compareStrings - * Signature: (JLjava/lang/String;ZLjava/lang/String;ZZZZZZZZZI)I + * Signature: (JLjava/lang/String;ZLjava/lang/String;ZII)I */ JNIEXPORT jint JNICALL Java_xflaim_DbSystem__1compareStrings - (JNIEnv *, jobject, jlong, jstring, jboolean, jstring, jboolean, jboolean, jboolean, jboolean, jboolean, jboolean, jboolean, jboolean, jboolean, jint); + (JNIEnv *, jobject, jlong, jstring, jboolean, jstring, jboolean, jint, jint); /* * Class: xflaim_DbSystem * Method: _hasSubStr - * Signature: (JLjava/lang/String;Ljava/lang/String;ZZZZZZZZI)Z + * Signature: (JLjava/lang/String;Ljava/lang/String;II)Z */ JNIEXPORT jboolean JNICALL Java_xflaim_DbSystem__1hasSubStr - (JNIEnv *, jobject, jlong, jstring, jstring, jboolean, jboolean, jboolean, jboolean, jboolean, jboolean, jboolean, jboolean, jint); + (JNIEnv *, jobject, jlong, jstring, jstring, jint, jint); /* * Class: xflaim_DbSystem diff --git a/xflaim/java/jni/xflaim_OptInfo.h b/xflaim/java/jni/xflaim_OptInfo.h new file mode 100644 index 0000000..adcebe1 --- /dev/null +++ b/xflaim/java/jni/xflaim_OptInfo.h @@ -0,0 +1,21 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class xflaim_OptInfo */ + +#ifndef _Included_xflaim_OptInfo +#define _Included_xflaim_OptInfo +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: xflaim_OptInfo + * Method: initIDs + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_xflaim_OptInfo_initIDs + (JNIEnv *, jclass); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/xflaim/java/jni/xflaim_OptType.h b/xflaim/java/jni/xflaim_OptType.h new file mode 100644 index 0000000..8270608 --- /dev/null +++ b/xflaim/java/jni/xflaim_OptType.h @@ -0,0 +1,23 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class xflaim_OptType */ + +#ifndef _Included_xflaim_OptType +#define _Included_xflaim_OptType +#ifdef __cplusplus +extern "C" { +#endif +#undef xflaim_OptType_XFLM_QOPT_NONE +#define xflaim_OptType_XFLM_QOPT_NONE 0L +#undef xflaim_OptType_XFLM_QOPT_USING_INDEX +#define xflaim_OptType_XFLM_QOPT_USING_INDEX 1L +#undef xflaim_OptType_XFLM_QOPT_FULL_COLLECTION_SCAN +#define xflaim_OptType_XFLM_QOPT_FULL_COLLECTION_SCAN 2L +#undef xflaim_OptType_XFLM_QOPT_SINGLE_NODE_ID +#define xflaim_OptType_XFLM_QOPT_SINGLE_NODE_ID 3L +#undef xflaim_OptType_XFLM_QOPT_NODE_ID_RANGE +#define xflaim_OptType_XFLM_QOPT_NODE_ID_RANGE 4L +#ifdef __cplusplus +} +#endif +#endif diff --git a/xflaim/java/jni/xflaim_Query.h b/xflaim/java/jni/xflaim_Query.h index 684c0eb..0b39734 100644 --- a/xflaim/java/jni/xflaim_Query.h +++ b/xflaim/java/jni/xflaim_Query.h @@ -58,18 +58,10 @@ JNIEXPORT void JNICALL Java_xflaim_Query__1addXPathComponent /* * Class: xflaim_Query * Method: _addOperator - * Signature: (JI)V + * Signature: (JII)V */ JNIEXPORT void JNICALL Java_xflaim_Query__1addOperator - (JNIEnv *, jobject, jlong, jint); - -/* - * Class: xflaim_Query - * Method: _addStringOperator - * Signature: (JIZZZZZZZZ)V - */ -JNIEXPORT void JNICALL Java_xflaim_Query__1addStringOperator - (JNIEnv *, jobject, jlong, jint, jboolean, jboolean, jboolean, jboolean, jboolean, jboolean, jboolean, jboolean); + (JNIEnv *, jobject, jlong, jint, jint); /* * Class: xflaim_Query @@ -103,6 +95,166 @@ JNIEXPORT void JNICALL Java_xflaim_Query__1addLongValue JNIEXPORT void JNICALL Java_xflaim_Query__1addBoolean (JNIEnv *, jobject, jlong, jboolean, jboolean); +/* + * Class: xflaim_Query + * Method: _getFirst + * Signature: (JJJI)J + */ +JNIEXPORT jlong JNICALL Java_xflaim_Query__1getFirst + (JNIEnv *, jobject, jlong, jlong, jlong, jint); + +/* + * Class: xflaim_Query + * Method: _getLast + * Signature: (JJJI)J + */ +JNIEXPORT jlong JNICALL Java_xflaim_Query__1getLast + (JNIEnv *, jobject, jlong, jlong, jlong, jint); + +/* + * Class: xflaim_Query + * Method: _getNext + * Signature: (JJJII)J + */ +JNIEXPORT jlong JNICALL Java_xflaim_Query__1getNext + (JNIEnv *, jobject, jlong, jlong, jlong, jint, jint); + +/* + * Class: xflaim_Query + * Method: _getPrev + * Signature: (JJJII)J + */ +JNIEXPORT jlong JNICALL Java_xflaim_Query__1getPrev + (JNIEnv *, jobject, jlong, jlong, jlong, jint, jint); + +/* + * Class: xflaim_Query + * Method: _getCurrent + * Signature: (JJJ)J + */ +JNIEXPORT jlong JNICALL Java_xflaim_Query__1getCurrent + (JNIEnv *, jobject, jlong, jlong, jlong); + +/* + * Class: xflaim_Query + * Method: _resetQuery + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_xflaim_Query__1resetQuery + (JNIEnv *, jobject, jlong); + +/* + * Class: xflaim_Query + * Method: _getStatsAndOptInfo + * Signature: (J)[Lxflaim/OptInfo; + */ +JNIEXPORT jobjectArray JNICALL Java_xflaim_Query__1getStatsAndOptInfo + (JNIEnv *, jobject, jlong); + +/* + * Class: xflaim_Query + * Method: _setDupHandling + * Signature: (JZ)V + */ +JNIEXPORT void JNICALL Java_xflaim_Query__1setDupHandling + (JNIEnv *, jobject, jlong, jboolean); + +/* + * Class: xflaim_Query + * Method: _setIndex + * Signature: (JI)V + */ +JNIEXPORT void JNICALL Java_xflaim_Query__1setIndex + (JNIEnv *, jobject, jlong, jint); + +/* + * Class: xflaim_Query + * Method: _getIndex + * Signature: (JJ)I + */ +JNIEXPORT jint JNICALL Java_xflaim_Query__1getIndex + (JNIEnv *, jobject, jlong, jlong); + +/* + * Class: xflaim_Query + * Method: _usesMultipleIndexes + * Signature: (JJ)Z + */ +JNIEXPORT jboolean JNICALL Java_xflaim_Query__1usesMultipleIndexes + (JNIEnv *, jobject, jlong, jlong); + +/* + * Class: xflaim_Query + * Method: _addSortKey + * Signature: (JJZZIIIIZZ)J + */ +JNIEXPORT jlong JNICALL Java_xflaim_Query__1addSortKey + (JNIEnv *, jobject, jlong, jlong, jboolean, jboolean, jint, jint, jint, jint, jboolean, jboolean); + +/* + * Class: xflaim_Query + * Method: _enablePositioning + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_xflaim_Query__1enablePositioning + (JNIEnv *, jobject, jlong); + +/* + * Class: xflaim_Query + * Method: _positionTo + * Signature: (JJJII)J + */ +JNIEXPORT jlong JNICALL Java_xflaim_Query__1positionTo + (JNIEnv *, jobject, jlong, jlong, jlong, jint, jint); + +/* + * Class: xflaim_Query + * Method: _positionTo2 + * Signature: (JJJIJI)J + */ +JNIEXPORT jlong JNICALL Java_xflaim_Query__1positionTo2 + (JNIEnv *, jobject, jlong, jlong, jlong, jint, jlong, jint); + +/* + * Class: xflaim_Query + * Method: _getPosition + * Signature: (JJ)I + */ +JNIEXPORT jint JNICALL Java_xflaim_Query__1getPosition + (JNIEnv *, jobject, jlong, jlong); + +/* + * Class: xflaim_Query + * Method: _buildResultSet + * Signature: (JJI)V + */ +JNIEXPORT void JNICALL Java_xflaim_Query__1buildResultSet + (JNIEnv *, jobject, jlong, jlong, jint); + +/* + * Class: xflaim_Query + * Method: _stopBuildingResultSet + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_xflaim_Query__1stopBuildingResultSet + (JNIEnv *, jobject, jlong); + +/* + * Class: xflaim_Query + * Method: _enableResultSetEncryption + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_xflaim_Query__1enableResultSetEncryption + (JNIEnv *, jobject, jlong); + +/* + * Class: xflaim_Query + * Method: _getResultSetCounts + * Signature: (JJIZ)Lxflaim/ResultSetCounts; + */ +JNIEXPORT jobject JNICALL Java_xflaim_Query__1getResultSetCounts + (JNIEnv *, jobject, jlong, jlong, jint, jboolean); + #ifdef __cplusplus } #endif diff --git a/xflaim/java/jni/xflaim_QueryOperators.h b/xflaim/java/jni/xflaim_QueryOperators.h new file mode 100644 index 0000000..9dcb278 --- /dev/null +++ b/xflaim/java/jni/xflaim_QueryOperators.h @@ -0,0 +1,63 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class xflaim_QueryOperators */ + +#ifndef _Included_xflaim_QueryOperators +#define _Included_xflaim_QueryOperators +#ifdef __cplusplus +extern "C" { +#endif +#undef xflaim_QueryOperators_XFLM_UNKNOWN_OP +#define xflaim_QueryOperators_XFLM_UNKNOWN_OP 0L +#undef xflaim_QueryOperators_XFLM_AND_OP +#define xflaim_QueryOperators_XFLM_AND_OP 1L +#undef xflaim_QueryOperators_XFLM_OR_OP +#define xflaim_QueryOperators_XFLM_OR_OP 2L +#undef xflaim_QueryOperators_XFLM_NOT_OP +#define xflaim_QueryOperators_XFLM_NOT_OP 3L +#undef xflaim_QueryOperators_XFLM_EQ_OP +#define xflaim_QueryOperators_XFLM_EQ_OP 4L +#undef xflaim_QueryOperators_XFLM_NE_OP +#define xflaim_QueryOperators_XFLM_NE_OP 5L +#undef xflaim_QueryOperators_XFLM_APPROX_EQ_OP +#define xflaim_QueryOperators_XFLM_APPROX_EQ_OP 6L +#undef xflaim_QueryOperators_XFLM_LT_OP +#define xflaim_QueryOperators_XFLM_LT_OP 7L +#undef xflaim_QueryOperators_XFLM_LE_OP +#define xflaim_QueryOperators_XFLM_LE_OP 8L +#undef xflaim_QueryOperators_XFLM_GT_OP +#define xflaim_QueryOperators_XFLM_GT_OP 9L +#undef xflaim_QueryOperators_XFLM_GE_OP +#define xflaim_QueryOperators_XFLM_GE_OP 10L +#undef xflaim_QueryOperators_XFLM_BITAND_OP +#define xflaim_QueryOperators_XFLM_BITAND_OP 11L +#undef xflaim_QueryOperators_XFLM_BITOR_OP +#define xflaim_QueryOperators_XFLM_BITOR_OP 12L +#undef xflaim_QueryOperators_XFLM_BITXOR_OP +#define xflaim_QueryOperators_XFLM_BITXOR_OP 13L +#undef xflaim_QueryOperators_XFLM_MULT_OP +#define xflaim_QueryOperators_XFLM_MULT_OP 14L +#undef xflaim_QueryOperators_XFLM_DIV_OP +#define xflaim_QueryOperators_XFLM_DIV_OP 15L +#undef xflaim_QueryOperators_XFLM_MOD_OP +#define xflaim_QueryOperators_XFLM_MOD_OP 16L +#undef xflaim_QueryOperators_XFLM_PLUS_OP +#define xflaim_QueryOperators_XFLM_PLUS_OP 17L +#undef xflaim_QueryOperators_XFLM_MINUS_OP +#define xflaim_QueryOperators_XFLM_MINUS_OP 18L +#undef xflaim_QueryOperators_XFLM_NEG_OP +#define xflaim_QueryOperators_XFLM_NEG_OP 19L +#undef xflaim_QueryOperators_XFLM_LPAREN_OP +#define xflaim_QueryOperators_XFLM_LPAREN_OP 20L +#undef xflaim_QueryOperators_XFLM_RPAREN_OP +#define xflaim_QueryOperators_XFLM_RPAREN_OP 21L +#undef xflaim_QueryOperators_XFLM_COMMA_OP +#define xflaim_QueryOperators_XFLM_COMMA_OP 22L +#undef xflaim_QueryOperators_XFLM_LBRACKET_OP +#define xflaim_QueryOperators_XFLM_LBRACKET_OP 23L +#undef xflaim_QueryOperators_XFLM_RBRACKET_OP +#define xflaim_QueryOperators_XFLM_RBRACKET_OP 24L +#ifdef __cplusplus +} +#endif +#endif diff --git a/xflaim/java/jni/xflaim_ResultSetCounts.h b/xflaim/java/jni/xflaim_ResultSetCounts.h new file mode 100644 index 0000000..3bd7370 --- /dev/null +++ b/xflaim/java/jni/xflaim_ResultSetCounts.h @@ -0,0 +1,21 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class xflaim_ResultSetCounts */ + +#ifndef _Included_xflaim_ResultSetCounts +#define _Included_xflaim_ResultSetCounts +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: xflaim_ResultSetCounts + * Method: initIDs + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_xflaim_ResultSetCounts_initIDs + (JNIEnv *, jclass); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/xflaim/java/jni/xflaim_SearchFlags.h b/xflaim/java/jni/xflaim_SearchFlags.h new file mode 100644 index 0000000..d7af1e0 --- /dev/null +++ b/xflaim/java/jni/xflaim_SearchFlags.h @@ -0,0 +1,29 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class xflaim_SearchFlags */ + +#ifndef _Included_xflaim_SearchFlags +#define _Included_xflaim_SearchFlags +#ifdef __cplusplus +extern "C" { +#endif +#undef xflaim_SearchFlags_XFLM_INCL +#define xflaim_SearchFlags_XFLM_INCL 16L +#undef xflaim_SearchFlags_XFLM_EXCL +#define xflaim_SearchFlags_XFLM_EXCL 32L +#undef xflaim_SearchFlags_XFLM_EXACT +#define xflaim_SearchFlags_XFLM_EXACT 64L +#undef xflaim_SearchFlags_XFLM_KEY_EXACT +#define xflaim_SearchFlags_XFLM_KEY_EXACT 128L +#undef xflaim_SearchFlags_XFLM_FIRST +#define xflaim_SearchFlags_XFLM_FIRST 256L +#undef xflaim_SearchFlags_XFLM_LAST +#define xflaim_SearchFlags_XFLM_LAST 512L +#undef xflaim_SearchFlags_XFLM_MATCH_IDS +#define xflaim_SearchFlags_XFLM_MATCH_IDS 1024L +#undef xflaim_SearchFlags_XFLM_MATCH_DOC_ID +#define xflaim_SearchFlags_XFLM_MATCH_DOC_ID 2048L +#ifdef __cplusplus +} +#endif +#endif diff --git a/xflaim/java/jni/xflaim_XPathAxis.h b/xflaim/java/jni/xflaim_XPathAxis.h new file mode 100644 index 0000000..7e7f509 --- /dev/null +++ b/xflaim/java/jni/xflaim_XPathAxis.h @@ -0,0 +1,43 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class xflaim_XPathAxis */ + +#ifndef _Included_xflaim_XPathAxis +#define _Included_xflaim_XPathAxis +#ifdef __cplusplus +extern "C" { +#endif +#undef xflaim_XPathAxis_ROOT_AXIS +#define xflaim_XPathAxis_ROOT_AXIS 0L +#undef xflaim_XPathAxis_CHILD_AXIS +#define xflaim_XPathAxis_CHILD_AXIS 1L +#undef xflaim_XPathAxis_PARENT_AXIS +#define xflaim_XPathAxis_PARENT_AXIS 2L +#undef xflaim_XPathAxis_ANCESTOR_AXIS +#define xflaim_XPathAxis_ANCESTOR_AXIS 3L +#undef xflaim_XPathAxis_DESCENDANT_AXIS +#define xflaim_XPathAxis_DESCENDANT_AXIS 4L +#undef xflaim_XPathAxis_FOLLOWING_SIBLING_AXIS +#define xflaim_XPathAxis_FOLLOWING_SIBLING_AXIS 5L +#undef xflaim_XPathAxis_PRECEDING_SIBLING_AXIS +#define xflaim_XPathAxis_PRECEDING_SIBLING_AXIS 6L +#undef xflaim_XPathAxis_FOLLOWING_AXIS +#define xflaim_XPathAxis_FOLLOWING_AXIS 7L +#undef xflaim_XPathAxis_PRECEDING_AXIS +#define xflaim_XPathAxis_PRECEDING_AXIS 8L +#undef xflaim_XPathAxis_ATTRIBUTE_AXIS +#define xflaim_XPathAxis_ATTRIBUTE_AXIS 9L +#undef xflaim_XPathAxis_NAMESPACE_AXIS +#define xflaim_XPathAxis_NAMESPACE_AXIS 10L +#undef xflaim_XPathAxis_SELF_AXIS +#define xflaim_XPathAxis_SELF_AXIS 11L +#undef xflaim_XPathAxis_DESCENDANT_OR_SELF_AXIS +#define xflaim_XPathAxis_DESCENDANT_OR_SELF_AXIS 12L +#undef xflaim_XPathAxis_ANCESTOR_OR_SELF_AXIS +#define xflaim_XPathAxis_ANCESTOR_OR_SELF_AXIS 13L +#undef xflaim_XPathAxis_META_AXIS +#define xflaim_XPathAxis_META_AXIS 14L +#ifdef __cplusplus +} +#endif +#endif diff --git a/xflaim/java/xflaim/CompareRules.java b/xflaim/java/xflaim/CompareRules.java new file mode 100644 index 0000000..2f9e48a --- /dev/null +++ b/xflaim/java/xflaim/CompareRules.java @@ -0,0 +1,44 @@ +//------------------------------------------------------------------------------ +// Desc: CompareRules +// +// Tabs: 3 +// +// Copyright (c) 2006 Novell, Inc. All Rights Reserved. +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of version 2 of the GNU General Public +// License as published by the Free Software Foundation. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, contact Novell, Inc. +// +// To contact Novell about this file by physical or electronic mail, +// you may find current contact information at www.novell.com +// +// $Id$ +//------------------------------------------------------------------------------ + +package xflaim; + +/** + * Provides bit flags for comparison rules. + */ + +public final class CompareRules +{ + public static final int FLM_COMP_CASE_INSENSITIVE = 0x0001; + public static final int FLM_COMP_COMPRESS_WHITESPACE = 0x0002; + public static final int FLM_COMP_NO_WHITESPACE = 0x0004; + public static final int FLM_COMP_NO_UNDERSCORES = 0x0008; + public static final int FLM_COMP_NO_DASHES = 0x0010; + public static final int FLM_COMP_WHITESPACE_AS_SPACE = 0x0020; + public static final int FLM_COMP_IGNORE_LEADING_SPACE = 0x0040; + public static final int FLM_COMP_IGNORE_TRAILING_SPACE = 0x0080; + public static final int FLM_COMP_WILD = 0x0100; +} + diff --git a/xflaim/java/xflaim/DataVector.java b/xflaim/java/xflaim/DataVector.java index 78c6eeb..20dfee0 100644 --- a/xflaim/java/xflaim/DataVector.java +++ b/xflaim/java/xflaim/DataVector.java @@ -49,6 +49,11 @@ public class DataVector m_dbSystem = dbSystem; } + public long getThis() + { + return m_this; + } + /** * Finalizer method, used to ensure that we release the actual C++ object. */ diff --git a/xflaim/java/xflaim/Db.java b/xflaim/java/xflaim/Db.java index b5a332a..40fdf87 100644 --- a/xflaim/java/xflaim/Db.java +++ b/xflaim/java/xflaim/Db.java @@ -283,7 +283,8 @@ public class Db * @param iIndex The index that is being searched * @param jSearchKey The DataVector search key * @param iFlags The search flags that direct how the next key will - * be determined. + * be determined. This should be values from + * {@link xflaim.SearchFlags SearchFlags} that are ORed together. * @param jFoundKey This parameter is used during subsequent calls * to keyRetrieve. The returned DataVector is passed in as this * parameter so that it may be reused, thus preventing the unnecessary diff --git a/xflaim/java/xflaim/DbSystem.java b/xflaim/java/xflaim/DbSystem.java index 0d90dae..8123a28 100644 --- a/xflaim/java/xflaim/DbSystem.java +++ b/xflaim/java/xflaim/DbSystem.java @@ -735,41 +735,20 @@ public class DbSystem boolean bLeftWild, String sRightString, boolean bRightWild, - boolean bCaseInsensitive, - boolean bCompressWhitespace, - boolean bNoWhitespace, - boolean bNoUnderscores, - boolean bNoDashes, - boolean bWhitespaceAsSpace, - boolean bIgnoreLeadingSpace, - boolean bIgnoreTrailingSpace, + int iCompareRules, int iLanguage) throws XFlaimException { - return( _compareStrings( m_this, - sLeftString, bLeftWild, - sRightString, bRightWild, - bCaseInsensitive, bCompressWhitespace, bNoWhitespace, - bNoUnderscores, bNoDashes, bWhitespaceAsSpace, - bIgnoreLeadingSpace, bIgnoreTrailingSpace, iLanguage)); + return( _compareStrings( m_this, sLeftString, bLeftWild, + sRightString, bRightWild, iCompareRules, iLanguage)); } public boolean hasSubStr( String sString, String sSubString, - boolean bCaseInsensitive, - boolean bCompressWhitespace, - boolean bNoWhitespace, - boolean bNoUnderscores, - boolean bNoDashes, - boolean bWhitespaceAsSpace, - boolean bIgnoreLeadingSpace, - boolean bIgnoreTrailingSpace, + int iCompareRules, int iLanguage) throws XFlaimException { - return( _hasSubStr( m_this, sString, sSubString, bCaseInsensitive, - bCompressWhitespace, bNoWhitespace, bNoUnderscores, bNoDashes, - bWhitespaceAsSpace, bIgnoreLeadingSpace, bIgnoreTrailingSpace, - iLanguage)); + return( _hasSubStr( m_this, sString, sSubString, iCompareRules, iLanguage)); } public boolean uniIsUpper( @@ -1084,28 +1063,14 @@ public class DbSystem boolean bLeftWild, String sRightString, boolean bRightWild, - boolean bCaseInsensitive, - boolean bCompressWhitespace, - boolean bNoWhitespace, - boolean bNoUnderscores, - boolean bNoDashes, - boolean bWhitespaceAsSpace, - boolean bIgnoreLeadingSpace, - boolean bIgnoreTrailingSpace, + int iCompareRules, int iLanguage) throws XFlaimException; private native boolean _hasSubStr( long lThis, String sString, String sSubString, - boolean bCaseInsensitive, - boolean bCompressWhitespace, - boolean bNoWhitespace, - boolean bNoUnderscores, - boolean bNoDashes, - boolean bWhitespaceAsSpace, - boolean bIgnoreLeadingSpace, - boolean bIgnoreTrailingSpace, + int iCompareRules, int iLanguage) throws XFlaimException; private native boolean _uniIsUpper( diff --git a/xflaim/java/xflaim/OptInfo.java b/xflaim/java/xflaim/OptInfo.java new file mode 100644 index 0000000..e1bd6ee --- /dev/null +++ b/xflaim/java/xflaim/OptInfo.java @@ -0,0 +1,63 @@ +//------------------------------------------------------------------------------ +// Desc: OptInfo +// +// Tabs: 3 +// +// Copyright (c) 2006 Novell, Inc. All Rights Reserved. +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of version 2 of the GNU General Public +// License as published by the Free Software Foundation. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, contact Novell, Inc. +// +// To contact Novell about this file by physical or electronic mail, +// you may find current contact information at www.novell.com +// +// $Id$ +//------------------------------------------------------------------------------ + +package xflaim; + +/** + * This class encapsulates optimization information returned from a Query object. + */ +public final class OptInfo +{ + public int iOptType; // Type of optimization done + public int iCost; // Cost calculated for predicate + public long lNodeId; // Only valid if iOptType is + // XFLM_QOPT_SINGLE_NODE_ID or + // XFLM_QOPT_NODE_ID_RANGE + public long lEndNodeId; // Only valid if iOptType is + // XFLM_QOPT_NODE_ID_RANGE + public int iIxNum; // Index used to execute query if + // iOptType == XFLM_QOPT_USING_INDEX + public String sIxName; + public boolean bMustVerifyPath; // Must verify node path. + public boolean bDoNodeMatch; // Node must be retrieved to exe + // query. Only valid if iOptType + // is XFLM_QOPT_USING_INDEX. + public boolean bCanCompareOnKey; // Can we compare on index keys? Only + // valid if iOptType == XFLM_QOPT_USING_INDEX. + public long lKeysRead; + public long lKeyHadDupDoc; + public long lKeysPassed; + public long lNodesRead; + public long lNodesTested; + public long lNodesPassed; + public long lDocsRead; + public long lDupDocsEliminated; + public long lNodesFailedValidation; + public long lDocsFailedValidation; + public long lDocsPassed; + + private static native void initIDs(); +} + diff --git a/xflaim/java/xflaim/OptType.java b/xflaim/java/xflaim/OptType.java new file mode 100644 index 0000000..c0cbb2d --- /dev/null +++ b/xflaim/java/xflaim/OptType.java @@ -0,0 +1,40 @@ +//------------------------------------------------------------------------------ +// Desc: OptType +// +// Tabs: 3 +// +// Copyright (c) 2006 Novell, Inc. All Rights Reserved. +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of version 2 of the GNU General Public +// License as published by the Free Software Foundation. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, contact Novell, Inc. +// +// To contact Novell about this file by physical or electronic mail, +// you may find current contact information at www.novell.com +// +// $Id$ +//------------------------------------------------------------------------------ + +package xflaim; + +/** + * Provides list of optimization types for queries + */ + +public final class OptType +{ + public static final int XFLM_QOPT_NONE = 0; + public static final int XFLM_QOPT_USING_INDEX = 1; + public static final int XFLM_QOPT_FULL_COLLECTION_SCAN = 2; + public static final int XFLM_QOPT_SINGLE_NODE_ID = 3; + public static final int XFLM_QOPT_NODE_ID_RANGE = 4; +} + diff --git a/xflaim/java/xflaim/Query.java b/xflaim/java/xflaim/Query.java index 49e9cd6..0cf7291 100644 --- a/xflaim/java/xflaim/Query.java +++ b/xflaim/java/xflaim/Query.java @@ -80,26 +80,52 @@ public class Query return m_this; } + /** + * Set the language for the query criteria. This affects how string + * comparisons are done. Collation is done according to the language + * specified. + * @param iLanguage Language to be used for string comparisons. + * @throws XFlaimException + */ public void setLanguage( int iLanguage) throws XFlaimException { _setLanguage( m_this, iLanguage); } + /** + * Setup the query criteria from the passed in string. + * @param sQuery String containing the query criteria. + * @throws XFlaimException + */ public void setupQueryExpr( String sQuery) throws XFlaimException { _setupQueryExpr( m_this, m_jdb.m_this, sQuery); } + /** + * Copy the query criteria from one Query object into this Query object. + * @param querytoCopy Query object whose criteria is to be copied. + * @throws XFlaimException + */ public void copyCriteria( Query queryToCopy) throws XFlaimException { _copyCriteria( m_this, queryToCopy.m_this); } + /** + * Add an XPATH component to a query. + * @param iXPathAxis Type of axis for the XPATH component being added. + * Should be one of the constants defined in {@link xflaim.XPathAxis XPathAxis}. + * @param iNodeType An integer representing the type of node for the + * XPATH component. + * (Use the constants in {@link xflaim.FlmDomNodeType FlmDomNodeType}.) + * @param iNameId Name ID for the node in the XPATH component. + * @throws XFlaimException + */ public void addXPathComponent( - long lThis, int iXPathAxis, int iNodeType, int iNameId) throws XFlaimException @@ -107,53 +133,585 @@ public class Query _addXPathComponent( m_this, iXPathAxis, iNodeType, iNameId); } + /** + * Add an operator to a query. + * @param iOperator Operator to be added. Should be one of the constants + * defined in {@link xflaim.QueryOperators QueryOperators}. + * @param iCompareRules. Flags for doing string comparisons. Should be + * logical ORs of the members of {@link xflaim.CompareRules CompareRules}. + * @throws XFlaimException + */ public void addOperator( - int iOperator) throws XFlaimException + int iOperator, + int iCompareRules) throws XFlaimException { - _addOperator( m_this, iOperator); + _addOperator( m_this, iOperator, iCompareRules); } - public void addStringOperator( - int iOperator, - boolean bCaseInsensitive, - boolean bCompressWhitespace, - boolean bNoWhitespace, - boolean bNoUnderscores, - boolean bNoDashes, - boolean bWhitespaceAsSpace, - boolean bIgnoreLeadingSpace, - boolean bIgnoreTrailingSpace) throws XFlaimException - { - _addStringOperator( m_this, iOperator, bCaseInsensitive, bCompressWhitespace, - bNoWhitespace, bNoUnderscores, bNoDashes, bWhitespaceAsSpace, - bIgnoreLeadingSpace, bIgnoreTrailingSpace); - } - + /** + * Add a string value to the query criteria. + * @param sValue String value to be added to criteria. + * @throws XFlaimException + */ public void addStringValue( String sValue) throws XFlaimException { _addStringValue( m_this, sValue); } + /** + * Add a binary value to the query criteria. + * @param Value Binary value to be added to criteria. + * @throws XFlaimException + */ public void addBinaryValue( byte [] Value) throws XFlaimException { _addBinaryValue( m_this, Value); } + /** + * Add a long value to the query criteria. + * @param lValue Long value to be added to criteria. + * @throws XFlaimException + */ public void addLongValue( long lValue) throws XFlaimException { _addLongValue( m_this, lValue); } + /** + * Add a boolean to the query criteria. + * @param bValue Boolean value to be added to criteria. + * @throws XFlaimException + */ public void addBoolean( - boolean bValue, - boolean bUnknown) throws XFlaimException + boolean bValue) throws XFlaimException { - _addBoolean( m_this, bValue, bUnknown); + _addBoolean( m_this, bValue, false); } + /** + * Add an "unknown" predicate to the query criteria. + * @param bValue Boolean value to be added to criteria. + * @throws XFlaimException + */ + public void addUnknown() throws XFlaimException + { + _addBoolean( m_this, false, true); + } + + /** + * Gets the first {@link xflaim.DOMNode DOM node} that satisfies the query criteria. + * This may be a document root node, or any node within the document. What + * is returned depends on how the XPATH expression was constructed. + * @param ReusedNode An existing {@link xflaim.DOMNode DOMNode} object + * can optionally be passed in, and it will be reused instead of a new + * object being allocated. + * @param iTimeLimit Time limit (in milliseconds) for operation to complete. + * A value of zero indicates that the operation should not time out. + * @return Returns an instance of {@link xflaim.DOMNode DOMNode}. + * @throws XFlaimException + */ + public DOMNode getFirst( + DOMNode ReusedNode, + int iTimeLimit) throws XFlaimException + { + long lNewNodeRef = 0; + DOMNode NewNode; + long lReusedNodeRef = (ReusedNode != null) + ? ReusedNode.getThis() + : 0; + + // See to comments in the finalize function for an explanation of this + // call synchronized call + + synchronized( m_jdb) + { + lNewNodeRef = _getFirst( m_this, m_jdb.m_this, lReusedNodeRef, + iTimeLimit); + } + + if (ReusedNode == null) + { + NewNode = new DOMNode(lNewNodeRef, m_jdb); + } + else + { + NewNode=ReusedNode; + NewNode.setRef( lNewNodeRef, m_jdb); + } + + return( NewNode); + } + + /** + * Gets the last {@link xflaim.DOMNode DOM node} that satisfies the query criteria. + * This may be a document root node, or any node within the document. What + * is returned depends on how the XPATH expression was constructed. + * @param ReusedNode An existing {@link xflaim.DOMNode DOMNode} object + * can optionally be passed in, and it will be reused instead of a new + * object being allocated. + * @param iTimeLimit Time limit (in milliseconds) for operation to complete. + * A value of zero indicates that the operation should not time out. + * @return Returns an instance of {@link xflaim.DOMNode DOMNode}. + * @throws XFlaimException + */ + public DOMNode getLast( + DOMNode ReusedNode, + int iTimeLimit) throws XFlaimException + { + long lNewNodeRef = 0; + DOMNode NewNode; + long lReusedNodeRef = (ReusedNode != null) + ? ReusedNode.getThis() + : 0; + + // See to comments in the finalize function for an explanation of this + // call synchronized call + + synchronized( m_jdb) + { + lNewNodeRef = _getLast( m_this, m_jdb.m_this, lReusedNodeRef, + iTimeLimit); + } + + if (ReusedNode == null) + { + NewNode = new DOMNode(lNewNodeRef, m_jdb); + } + else + { + NewNode=ReusedNode; + NewNode.setRef( lNewNodeRef, m_jdb); + } + + return( NewNode); + } + + /** + * Gets the next {@link xflaim.DOMNode DOM node} that satisfies the query criteria. + * This may be a document root node, or any node within the document. What + * is returned depends on how the XPATH expression was constructed. + * @param ReusedNode An existing {@link xflaim.DOMNode DOMNode} object + * can optionally be passed in, and it will be reused instead of a new + * object being allocated. + * @param iTimeLimit Time limit (in milliseconds) for operation to complete. + * A value of zero indicates that the operation should not time out. + * @param iNumToSkip Specifies the number of nodes to skip over before + * returning a next node. This includes skipping over the node the + * query is currently positioned on. A value of zero has the same effect + * as a value of one - it will position to the next node and return it. + * @return Returns an instance of {@link xflaim.DOMNode DOMNode}. + * @throws XFlaimException + */ + public DOMNode getNext( + DOMNode ReusedNode, + int iTimeLimit, + int iNumToSkip) throws XFlaimException + { + long lNewNodeRef = 0; + DOMNode NewNode; + long lReusedNodeRef = (ReusedNode != null) + ? ReusedNode.getThis() + : 0; + + // See to comments in the finalize function for an explanation of this + // call synchronized call + + synchronized( m_jdb) + { + lNewNodeRef = _getNext( m_this, m_jdb.m_this, lReusedNodeRef, + iTimeLimit, iNumToSkip); + } + + if (ReusedNode == null) + { + NewNode = new DOMNode(lNewNodeRef, m_jdb); + } + else + { + NewNode=ReusedNode; + NewNode.setRef( lNewNodeRef, m_jdb); + } + + return( NewNode); + } + + /** + * Gets the previous {@link xflaim.DOMNode DOM node} that satisfies the query criteria. + * This may be a document root node, or any node within the document. What + * is returned depends on how the XPATH expression was constructed. + * @param ReusedNode An existing {@link xflaim.DOMNode DOMNode} object + * can optionally be passed in, and it will be reused instead of a new + * object being allocated. + * @param iTimeLimit Time limit (in milliseconds) for operation to complete. + * A value of zero indicates that the operation should not time out. + * @param iNumToSkip Specifies the number of nodes to skip over before + * returning a previous node. This includes skipping over the node the + * query is currently positioned on. A value of zero has the same effect + * as a value of one - it will position to the previous node and return it. + * @return Returns an instance of {@link xflaim.DOMNode DOMNode}. + * @throws XFlaimException + */ + public DOMNode getPrev( + DOMNode ReusedNode, + int iTimeLimit, + int iNumToSkip) throws XFlaimException + { + long lNewNodeRef = 0; + DOMNode NewNode; + long lReusedNodeRef = (ReusedNode != null) + ? ReusedNode.getThis() + : 0; + + // See to comments in the finalize function for an explanation of this + // call synchronized call + + synchronized( m_jdb) + { + lNewNodeRef = _getPrev( m_this, m_jdb.m_this, lReusedNodeRef, + iTimeLimit, iNumToSkip); + } + + if (ReusedNode == null) + { + NewNode = new DOMNode(lNewNodeRef, m_jdb); + } + else + { + NewNode=ReusedNode; + NewNode.setRef( lNewNodeRef, m_jdb); + } + + return( NewNode); + } + + /** + * Gets the current {@link xflaim.DOMNode DOM node} that was last returned by + * calls to getFirst, getLast, getNext, or getPrev. + * This may be a document root node, or any node within the document. What + * is returned depends on how the XPATH expression was constructed. + * @param ReusedNode An existing {@link xflaim.DOMNode DOMNode} object + * can optionally be passed in, and it will be reused instead of a new + * object being allocated. + * @return Returns an instance of {@link xflaim.DOMNode DOMNode}. + * @throws XFlaimException + */ + public DOMNode getCurrent( + DOMNode ReusedNode) throws XFlaimException + { + long lNewNodeRef = 0; + DOMNode NewNode; + long lReusedNodeRef = (ReusedNode != null) + ? ReusedNode.getThis() + : 0; + + // See to comments in the finalize function for an explanation of this + // call synchronized call + + synchronized( m_jdb) + { + lNewNodeRef = _getCurrent( m_this, m_jdb.m_this, lReusedNodeRef); + } + + if (ReusedNode == null) + { + NewNode = new DOMNode(lNewNodeRef, m_jdb); + } + else + { + NewNode=ReusedNode; + NewNode.setRef( lNewNodeRef, m_jdb); + } + + return( NewNode); + } + + /** + * Resets the query criteria and results set for the query. + * @throws XFlaimException + */ + public void resetQuery() throws XFlaimException + { + _resetQuery( m_this); + } + + /** + * Returns statistics and optimization information for the query. + * @return Returns an array of {@link xflaim.OptInfo OptInfo} objects. + * @throws XFlaimException + */ + public OptInfo [] getStatsAndOptInfo() throws XFlaimException + { + return( _getStatsAndOptInfo( m_this)); + } + + /** + * Set duplicate handling for the query. + * @param bRemoveDups Specifies whether duplicates should be removed from + * the result set. + * @throws XFlaimException + */ + public void setDupHandling( + boolean bRemoveDups) throws XFlaimException + { + _setDupHandling( m_this, bRemoveDups); + } + + /** + * Set an index for the query. + * @param iIndex Index that the query should use. + * @throws XFlaimException + */ + public void setIndex( + int iIndex) throws XFlaimException + { + _setIndex( m_this, iIndex); + } + + /** + * Get the index, if any, being used by the query. + * @return Returns the index being used by the query. NOTE: Zero is returned + * if no indexes are being used. If multiple indexes are being used, only + * the first one will be returned. Call usesMultipeIndexes to determine + * if the query is using multiple indexes. To see the list of indexes, + * call getStatsAndOptInfo. + * @throws XFlaimException + */ + public int getIndex() throws XFlaimException + { + return( _getIndex( m_this, m_jdb.m_this)); + } + + /** + * Determine if the query is using multiple indexes. + * @return Returns a boolean which indicates if the query is using more than + * one index. If zero or one index is being used, will return false. + * @throws XFlaimException + */ + public boolean usesMultipleIndexes() throws XFlaimException + { + return( _usesMultipleIndexes( m_this, m_jdb.m_this)); + } + + /** + * Add a sort key to the query. + * @param lSortKeyContext Context that the current sort key is to be added + * relative to - either as a child or a sibling. If this is the first + * sort key, a zero should be passed in here. Otherwise, the value returned + * from a previous call to addSortKey should be passed in. + * @param bChildToContext Indicates whether this sort key should be added as + * a child or a sibling to the sort key context that was passed in the + * lSortKeyContext parameter. NOTE: If lSortKeyContext is zero, then the + * bChildToContext parameter is ignored. + * @param bElement Indicates whether the current key component is an element or an + * attribute. + * @param iNameId Name ID of the current key component. + * @param iCompareRules Flags for doing string comparisons when sorting for + * this sort key component. Should be logical ORs of the members of + * {@link xflaim.CompareRules CompareRules}. + * @param iLimit Limit on the size of the key component. If the component + * is a string element or attribute, it is the number of characters. If the + * component is a binary element or attribute, it is the number of bytes. + * @param iKeyComponent Specifies which key component this sort key component + * is. A value of zero indicates that it is not a key component, but simply + * a context component for other key components. + * @param bSortDescending Indicates that this key component should be + * sorted in descending order. + * @param bSortMissingHigh Indicates that when the value for this key + * component is missing, it should be sorted high instead of low. + * @return Returns a value that can be passed back into subsequent calls + * to addSortKey when this component needs to be used as a context for + * subsequent components. + * one index. If zero or one index is being used, will return false. + * @throws XFlaimException + */ + public long addSortKey( + long lSortKeyContext, + boolean bChildToContext, + boolean bElement, + int iNameId, + int iCompareRules, + int iLimit, + int iKeyComponent, + boolean bSortDescending, + boolean bSortMissingHigh) throws XFlaimException + { + return( _addSortKey( m_this, lSortKeyContext, bChildToContext, bElement, + iNameId, iCompareRules, iLimit, iKeyComponent, bSortDescending, + bSortMissingHigh)); + } + + /** + * Enable absolute positioning in the query result set. + * @throws XFlaimException + */ + public void enablePositioning() throws XFlaimException + { + _enablePositioning( m_this); + } + + /** + * Position to the {@link xflaim.DOMNode DOM node} in the result that is at + * the absolute position specified by the iPosition parameter. + * @param ReusedNode An existing {@link xflaim.DOMNode DOMNode} object + * can optionally be passed in, and it will be reused instead of a new + * object being allocated. + * @param iTimeLimit Time limit (in milliseconds) for operation to complete. + * A value of zero indicates that the operation should not time out. + * @param iPosition Absolute position in the result set to position to. + * @return Returns an instance of {@link xflaim.DOMNode DOMNode}. + * @throws XFlaimException + */ + public DOMNode positionTo( + DOMNode ReusedNode, + int iTimeLimit, + int iPosition) throws XFlaimException + { + long lNewNodeRef = 0; + DOMNode NewNode; + long lReusedNodeRef = (ReusedNode != null) + ? ReusedNode.getThis() + : 0; + + // See to comments in the finalize function for an explanation of this + // call synchronized call + + synchronized( m_jdb) + { + lNewNodeRef = _positionTo( m_this, m_jdb.m_this, lReusedNodeRef, + iTimeLimit, iPosition); + } + + if (ReusedNode == null) + { + NewNode = new DOMNode(lNewNodeRef, m_jdb); + } + else + { + NewNode=ReusedNode; + NewNode.setRef( lNewNodeRef, m_jdb); + } + + return( NewNode); + } + + /** + * Position to the {@link xflaim.DOMNode DOM node} in the result that is at + * the position specified by the searchKey parameter. + * @param ReusedNode An existing {@link xflaim.DOMNode DOMNode} object + * can optionally be passed in, and it will be reused instead of a new + * object being allocated. + * @param iTimeLimit Time limit (in milliseconds) for operation to complete. + * A value of zero indicates that the operation should not time out. + * @param searchKey This is a key that corresponds to the sort key that was + * specified using the addSortKey method. This method looks up the node + * in the result set that has this search key and returns it. + * @param iFlags The search flags that direct how the key is to be used + * to do positioning. This should be values from + * {@link xflaim.SearchFlags SearchFlags} that are ORed together. + * @return Returns an instance of {@link xflaim.DOMNode DOMNode}. + * @throws XFlaimException + */ + public DOMNode positionTo( + DOMNode ReusedNode, + int iTimeLimit, + DataVector searchKey, + int iFlags) throws XFlaimException + { + long lNewNodeRef = 0; + DOMNode NewNode; + long lReusedNodeRef = (ReusedNode != null) + ? ReusedNode.getThis() + : 0; + + // See to comments in the finalize function for an explanation of this + // call synchronized call + + synchronized( m_jdb) + { + lNewNodeRef = _positionTo2( m_this, m_jdb.m_this, lReusedNodeRef, + iTimeLimit, searchKey.getThis(), iFlags); + } + + if (ReusedNode == null) + { + NewNode = new DOMNode(lNewNodeRef, m_jdb); + } + else + { + NewNode=ReusedNode; + NewNode.setRef( lNewNodeRef, m_jdb); + } + + return( NewNode); + } + + /** + * Returns the absolute position within the result set where the query + * is currently positioned. + * @return Returns absolute position. + * @throws XFlaimException + */ + public int getPosition() throws XFlaimException + { + return( _getPosition( m_this, m_jdb.m_this)); + } + + /** + * Build the result set for the query. + * @param iTimeLimit Time limit (in milliseconds) for operation to complete. + * A value of zero indicates that the operation should not time out. + * @throws XFlaimException + */ + public void buildResultSet( + int iTimeLimit) throws XFlaimException + { + _buildResultSet( m_this, m_jdb.m_this, iTimeLimit); + } + + /** + * Stop building the result set for the query. + * @throws XFlaimException + */ + public void stopBuildingResultSet()throws XFlaimException + { + _stopBuildingResultSet( m_this); + } + + /** + * Enable encryption for the query result set while it is being built. + * Anything that overflows to disk will be encrypted. + * @throws XFlaimException + */ + public void enableResultSetEncryption() throws XFlaimException + { + _enableResultSetEncryption( m_this); + } + + /** + * Return counts about the result set that has either been built or is + * in the process of being built. + * @param iTimeLimit Time limit (in milliseconds) for operation to complete. + * A value of zero indicates that the operation should not time out. + * @param bPartialCountOk Specifies whether the method should wait for + * the result set to be completely built before returning counts. If true, + * the method will return the current counts, even if the result set is + * not completely built. + * @returns {@link xflaim.ResultSetCounts ResultSetCounts} object which + * contains various counts pertaining to the result set for the query. + * @throws XFlaimException + */ + public ResultSetCounts getResultSetCounts( + int iTimeLimit, + boolean bPartialCountOk) throws XFlaimException + { + return( _getResultSetCounts( m_this, m_jdb.m_this, + iTimeLimit, bPartialCountOk)); + } + // PRIVATE METHODS private native void _release( @@ -182,21 +740,10 @@ public class Query int iNameId) throws XFlaimException; private native void _addOperator( - long lThis, - int iOperator) throws XFlaimException; - - private native void _addStringOperator( long lThis, int iOperator, - boolean bCaseInsensitive, - boolean bCompressWhitespace, - boolean bNoWhitespace, - boolean bNoUnderscores, - boolean bNoDashes, - boolean bWhitespaceAsSpace, - boolean bIgnoreLeadingSpace, - boolean bIgnoreTrailingSpace) throws XFlaimException; - + int iCompareRules) throws XFlaimException; + private native void _addStringValue( long lThis, String sValue) throws XFlaimException; @@ -214,6 +761,110 @@ public class Query boolean bValue, boolean bUnknown) throws XFlaimException; + private native long _getFirst( + long lThis, + long lDbRef, + long lReusedNode, + int iTimeLimit) throws XFlaimException; + + private native long _getLast( + long lThis, + long lDbRef, + long lReusedNode, + int iTimeLimit) throws XFlaimException; + + private native long _getNext( + long lThis, + long lDbRef, + long lReusedNode, + int iTimeLimit, + int iNumToSkip) throws XFlaimException; + + private native long _getPrev( + long lThis, + long lDbRef, + long lReusedNode, + int iTimeLimit, + int iNumToSkip) throws XFlaimException; + + private native long _getCurrent( + long lThis, + long lDbRef, + long lReusedNode) throws XFlaimException; + + private native void _resetQuery( + long lThis) throws XFlaimException; + + private native OptInfo [] _getStatsAndOptInfo( + long lThis) throws XFlaimException; + + private native void _setDupHandling( + long lThis, + boolean bRemoveDups) throws XFlaimException; + + private native void _setIndex( + long lThis, + int iIndex) throws XFlaimException; + + private native int _getIndex( + long lThis, + long lDbRef) throws XFlaimException; + + private native boolean _usesMultipleIndexes( + long lThis, + long lDbRef) throws XFlaimException; + + private native long _addSortKey( + long lThis, + long lSortKeyContext, + boolean bChildToContext, + boolean bElement, + int iNameId, + int iCompareRules, + int iLimit, + int iKeyComponent, + boolean bSortDescending, + boolean bSortMissingHigh) throws XFlaimException; + + private native void _enablePositioning( + long lThis) throws XFlaimException; + + private native long _positionTo( + long lThis, + long lDbRef, + long lReusedNode, + int iTimeLimit, + int iPosition) throws XFlaimException; + + private native long _positionTo2( + long lThis, + long lDbRef, + long lReusedNode, + int iTimeLimit, + long lSearchKeyRef, + int iFlags) throws XFlaimException; + + private native int _getPosition( + long lThis, + long lDbRef) throws XFlaimException; + + private native void _buildResultSet( + long lThis, + long lDbRef, + int iTimeLimit) throws XFlaimException; + + private native void _stopBuildingResultSet( + long lThis) throws XFlaimException; + + private native void _enableResultSetEncryption( + long lThis) throws XFlaimException; + + private native ResultSetCounts _getResultSetCounts( + long lThis, + long lDbRef, + int iTimeLimit, + boolean bPartialCountOk) throws XFlaimException; + private long m_this; private Db m_jdb; } @@ -222,109 +873,10 @@ public class Query FUNCTIONS NOT YET IMPLEMENTED -virtual RCODE FLMAPI addFunction( - eQueryFunctions eFunction) = 0; - virtual RCODE FLMAPI addFunction( IF_QueryValFunc * pFuncObj, FLMBOOL bHasXPathExpr) = 0; -virtual RCODE FLMAPI getFirst( - IF_Db * pDb, - IF_DOMNode ** ppNode, - FLMUINT uiTimeLimit = 0) = 0; // milliseconds - -virtual RCODE FLMAPI getLast( - IF_Db * pDb, - IF_DOMNode ** ppNode, - FLMUINT uiTimeLimit = 0) = 0; // milliseconds - -virtual RCODE FLMAPI getNext( - IF_Db * pDb, - IF_DOMNode ** ppNode, - FLMUINT uiTimeLimit = 0, // milliseconds - FLMUINT uiNumToSkip = 0, - FLMUINT * puiNumSkipped = NULL) = 0; - -virtual RCODE FLMAPI getPrev( - IF_Db * pDb, - IF_DOMNode ** ppNode, - FLMUINT uiTimeLimit = 0, // milliseconds - FLMUINT uiNumToSkip = 0, - FLMUINT * puiNumSkipped = NULL) = 0; - -virtual RCODE FLMAPI getCurrent( - IF_Db * pDb, - IF_DOMNode ** ppNode) = 0; - -virtual void FLMAPI resetQuery( void) = 0; - -virtual RCODE FLMAPI getStatsAndOptInfo( - FLMUINT * puiNumOptInfos, - XFLM_OPT_INFO ** ppOptInfo) = 0; - -virtual void FLMAPI freeStatsAndOptInfo( - XFLM_OPT_INFO ** ppOptInfo) = 0; - -virtual void FLMAPI setDupHandling( - FLMBOOL bRemoveDups) = 0; - -virtual RCODE FLMAPI setIndex( - FLMUINT uiIndex) = 0; - -virtual RCODE FLMAPI getIndex( - IF_Db * pDb, - FLMUINT * puiIndex, - FLMBOOL * pbHaveMultiple) = 0; - -virtual RCODE FLMAPI addSortKey( - void * pvSortKeyContext, - FLMBOOL bChildToContext, - FLMBOOL bElement, - FLMUINT uiNameId, - FLMUINT uiCompareRules, - FLMUINT uiLimit, - FLMUINT uiKeyComponent, - FLMBOOL bSortDescending, - FLMBOOL bSortMissingHigh, - void ** ppvContext) = 0; - -virtual RCODE FLMAPI enablePositioning( void) = 0; - -virtual RCODE FLMAPI positionTo( - IF_Db * pDb, - IF_DOMNode ** ppNode, - FLMUINT uiTimeLimit, - FLMUINT uiPosition) = 0; - -virtual RCODE FLMAPI positionTo( - IF_Db * pDb, - IF_DOMNode ** ppNode, - FLMUINT uiTimeLimit, - IF_DataVector * pSearchKey, - FLMUINT uiFlags) = 0; - -virtual RCODE FLMAPI getPosition( - IF_Db * pDb, - FLMUINT * puiPosition) = 0; - -virtual RCODE FLMAPI buildResultSet( - IF_Db * pDb, - FLMUINT uiTimeLimit) = 0; - -virtual void FLMAPI stopBuildingResultSet( void) = 0; - -virtual RCODE FLMAPI getCounts( - IF_Db * pDb, - FLMUINT uiTimeLimit, - FLMBOOL bPartialCountOk, - FLMUINT * puiReadCount, - FLMUINT * puiPassedCount, - FLMUINT * puiPositionableToCount, - FLMBOOL * pbDoneBuildingResultSet = NULL) = 0; - -virtual void FLMAPI enableResultSetEncryption( void) = 0; - virtual void FLMAPI setQueryStatusObject( IF_QueryStatus * pQueryStatus) = 0; diff --git a/xflaim/java/xflaim/QueryOperators.java b/xflaim/java/xflaim/QueryOperators.java new file mode 100644 index 0000000..42106c9 --- /dev/null +++ b/xflaim/java/xflaim/QueryOperators.java @@ -0,0 +1,60 @@ +//------------------------------------------------------------------------------ +// Desc: QueryOperators +// +// Tabs: 3 +// +// Copyright (c) 2006 Novell, Inc. All Rights Reserved. +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of version 2 of the GNU General Public +// License as published by the Free Software Foundation. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, contact Novell, Inc. +// +// To contact Novell about this file by physical or electronic mail, +// you may find current contact information at www.novell.com +// +// $Id$ +//------------------------------------------------------------------------------ + +package xflaim; + +/** + * Provides list of valid query operators. + */ + +public final class QueryOperators +{ + public static final int XFLM_UNKNOWN_OP = 0; + public static final int XFLM_AND_OP = 1; + public static final int XFLM_OR_OP = 2; + public static final int XFLM_NOT_OP = 3; + public static final int XFLM_EQ_OP = 4; + public static final int XFLM_NE_OP = 5; + public static final int XFLM_APPROX_EQ_OP = 6; + public static final int XFLM_LT_OP = 7; + public static final int XFLM_LE_OP = 8; + public static final int XFLM_GT_OP = 9; + public static final int XFLM_GE_OP = 10; + public static final int XFLM_BITAND_OP = 11; + public static final int XFLM_BITOR_OP = 12; + public static final int XFLM_BITXOR_OP = 13; + public static final int XFLM_MULT_OP = 14; + public static final int XFLM_DIV_OP = 15; + public static final int XFLM_MOD_OP = 16; + public static final int XFLM_PLUS_OP = 17; + public static final int XFLM_MINUS_OP = 18; + public static final int XFLM_NEG_OP = 19; + public static final int XFLM_LPAREN_OP = 20; + public static final int XFLM_RPAREN_OP = 21; + public static final int XFLM_COMMA_OP = 22; + public static final int XFLM_LBRACKET_OP = 23; + public static final int XFLM_RBRACKET_OP = 24; +} + diff --git a/xflaim/java/xflaim/ResultSetCounts.java b/xflaim/java/xflaim/ResultSetCounts.java new file mode 100644 index 0000000..40f1ed4 --- /dev/null +++ b/xflaim/java/xflaim/ResultSetCounts.java @@ -0,0 +1,40 @@ +//------------------------------------------------------------------------------ +// Desc: ResultSetCounts +// +// Tabs: 3 +// +// Copyright (c) 2006 Novell, Inc. All Rights Reserved. +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of version 2 of the GNU General Public +// License as published by the Free Software Foundation. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, contact Novell, Inc. +// +// To contact Novell about this file by physical or electronic mail, +// you may find current contact information at www.novell.com +// +// $Id$ +//------------------------------------------------------------------------------ + +package xflaim; + +/** + * This class encapsulates result set counts returned from a Query object. + */ +public final class ResultSetCounts +{ + public int iReadCount; + public int iPassedCount; + public int iPositionableToCount; + public boolean bDoneBuildingResultSet; + + private static native void initIDs(); +} + diff --git a/xflaim/java/xflaim/SearchFlags.java b/xflaim/java/xflaim/SearchFlags.java new file mode 100644 index 0000000..48b6a30 --- /dev/null +++ b/xflaim/java/xflaim/SearchFlags.java @@ -0,0 +1,43 @@ +//------------------------------------------------------------------------------ +// Desc: SearchFlags +// +// Tabs: 3 +// +// Copyright (c) 2006 Novell, Inc. All Rights Reserved. +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of version 2 of the GNU General Public +// License as published by the Free Software Foundation. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, contact Novell, Inc. +// +// To contact Novell about this file by physical or electronic mail, +// you may find current contact information at www.novell.com +// +// $Id$ +//------------------------------------------------------------------------------ + +package xflaim; + +/** + * Provides bit flags for comparison rules. + */ + +public final class SearchFlags +{ + public static final int XFLM_INCL = 0x0010; + public static final int XFLM_EXCL = 0x0020; + public static final int XFLM_EXACT = 0x0040; + public static final int XFLM_KEY_EXACT = 0x0080; + public static final int XFLM_FIRST = 0x0100; + public static final int XFLM_LAST = 0x0200; + public static final int XFLM_MATCH_IDS = 0x0400; + public static final int XFLM_MATCH_DOC_ID = 0x0800; +} + diff --git a/xflaim/java/xflaim/XPathAxis.java b/xflaim/java/xflaim/XPathAxis.java new file mode 100644 index 0000000..33a43d0 --- /dev/null +++ b/xflaim/java/xflaim/XPathAxis.java @@ -0,0 +1,50 @@ +//------------------------------------------------------------------------------ +// Desc: XPathAxis +// +// Tabs: 3 +// +// Copyright (c) 2006 Novell, Inc. All Rights Reserved. +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of version 2 of the GNU General Public +// License as published by the Free Software Foundation. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, contact Novell, Inc. +// +// To contact Novell about this file by physical or electronic mail, +// you may find current contact information at www.novell.com +// +// $Id$ +//------------------------------------------------------------------------------ + +package xflaim; + +/** + * Provides list of valid query operators. + */ + +public final class XPathAxis +{ + public static final int ROOT_AXIS = 0; + public static final int CHILD_AXIS = 1; + public static final int PARENT_AXIS = 2; + public static final int ANCESTOR_AXIS = 3; + public static final int DESCENDANT_AXIS = 4; + public static final int FOLLOWING_SIBLING_AXIS = 5; + public static final int PRECEDING_SIBLING_AXIS = 6; + public static final int FOLLOWING_AXIS = 7; + public static final int PRECEDING_AXIS = 8; + public static final int ATTRIBUTE_AXIS = 9; + public static final int NAMESPACE_AXIS = 10; + public static final int SELF_AXIS = 11; + public static final int DESCENDANT_OR_SELF_AXIS = 12; + public static final int ANCESTOR_OR_SELF_AXIS = 13; + public static final int META_AXIS = 14; +} +