コード例 #1
0
 protected boolean checkReferenceItemById(int querySentenceNr, int queryItemNr) {
   return ((specificationWordItem_ == null
       ? false
       : (querySentenceNr == Constants.NO_SENTENCE_NR
               ? true
               : specificationWordItem_.creationSentenceNr() == querySentenceNr)
           && (queryItemNr == Constants.NO_ITEM_NR
               ? true
               : specificationWordItem_.itemNr() == queryItemNr)));
 }
コード例 #2
0
  private String myWordTypeString(short queryWordTypeNr) {
    String myWordString = null;

    if (myList_ != null
        && !myList_.isAdminList()
        && // Don't show my word string when the item is in an admin list
        myWord_ != null
        && (myWordString = myWord_.wordTypeString(queryWordTypeNr)) == null)
      myWordString = myWord_.anyWordTypeString();

    return myWordString;
  }
コード例 #3
0
  protected StringBuffer toStringBuffer(short queryWordTypeNr) {
    String wordString;
    String contextWordTypeString = myWord().wordTypeName(contextWordTypeNr_);
    String specificationWordTypeString = myWord().wordTypeName(specificationWordTypeNr_);
    baseToStringBuffer(queryWordTypeNr);

    if (isPossessive_)
      CommonVariables.queryStringBuffer.append(Constants.QUERY_SEPARATOR_STRING + "isPossessive");

    CommonVariables.queryStringBuffer.append(
        Constants.QUERY_SEPARATOR_STRING
            + "contextWordType:"
            + (contextWordTypeString == null ? Constants.EMPTY_STRING : contextWordTypeString)
            + Constants.QUERY_WORD_TYPE_STRING
            + contextWordTypeNr_);

    if (contextNr_ > Constants.NO_CONTEXT_NR)
      CommonVariables.queryStringBuffer.append(
          Constants.QUERY_SEPARATOR_STRING + "contextNr:" + contextNr_);

    if (specificationWordTypeNr_ > Constants.WORD_TYPE_UNDEFINED)
      CommonVariables.queryStringBuffer.append(
          Constants.QUERY_SEPARATOR_STRING
              + "specificationWordType:"
              + (specificationWordTypeString == null
                  ? Constants.EMPTY_STRING
                  : specificationWordTypeString)
              + Constants.QUERY_WORD_TYPE_STRING
              + specificationWordTypeNr_);

    if (specificationWordItem_ != null) {
      CommonVariables.queryStringBuffer.append(
          Constants.QUERY_SEPARATOR_STRING
              + "specificationWordItem"
              + Constants.QUERY_REF_ITEM_START_CHAR
              + specificationWordItem_.creationSentenceNr()
              + Constants.QUERY_SEPARATOR_CHAR
              + specificationWordItem_.itemNr()
              + Constants.QUERY_REF_ITEM_END_CHAR);

      if ((wordString = specificationWordItem_.wordTypeString(specificationWordTypeNr_)) != null)
        CommonVariables.queryStringBuffer.append(
            Constants.QUERY_WORD_REFERENCE_START_CHAR
                + wordString
                + Constants.QUERY_WORD_REFERENCE_END_CHAR);
    }

    return CommonVariables.queryStringBuffer;
  }
コード例 #4
0
  protected byte findMatchingWordReferenceString(String queryString) {
    CommonVariables.foundMatchingStrings = false;

    if (specificationWordItem_ != null) {
      if (specificationWordItem_.findMatchingWordReferenceString(queryString)
          != Constants.RESULT_OK)
        addErrorInItem(
            1,
            null,
            null,
            "I failed to find a matching word reference string for the specification word");
    }

    return CommonVariables.result;
  }
コード例 #5
0
  protected void showWordReferences(boolean returnQueryToPosition) {
    String wordString;

    if (CommonVariables.queryStringBuffer == null)
      CommonVariables.queryStringBuffer = new StringBuffer();

    if (specificationWordItem_ != null
        && (wordString = specificationWordItem_.wordTypeString(specificationWordTypeNr_)) != null) {
      if (CommonVariables.foundQuery)
        CommonVariables.queryStringBuffer.append(
            returnQueryToPosition
                ? Constants.NEW_LINE_STRING
                : Constants.QUERY_SEPARATOR_SPACE_STRING);

      if (!isActiveItem()) // Show status when not active
      CommonVariables.queryStringBuffer.append(Constants.EMPTY_STRING + statusChar());

      CommonVariables.foundQuery = true;
      CommonVariables.queryStringBuffer.append(wordString);
    }
  }
コード例 #6
0
  protected StringBuffer baseToStringBuffer(short queryWordTypeNr) {
    String myWordString = myWordTypeString(queryWordTypeNr);
    String userNameString = (myWord_ == null ? null : myWord_.userName(userNr_));
    CommonVariables.queryStringBuffer = new StringBuffer();

    if (!isActiveItem()) // Show status when not active
    CommonVariables.queryStringBuffer.append(Constants.EMPTY_STRING + statusChar_);

    if (myWordString != null)
      CommonVariables.queryStringBuffer.append(
          Constants.QUERY_WORD_START_CHAR + myWordString + Constants.QUERY_WORD_END_CHAR);

    CommonVariables.queryStringBuffer.append(
        Constants.QUERY_LIST_START_STRING
            + (myList_ == null ? Constants.QUERY_NO_LIST_CHAR : myList_.listChar())
            + Constants.QUERY_LIST_END_CHAR);

    CommonVariables.queryStringBuffer.append(
        Constants.QUERY_ITEM_START_STRING
            + creationSentenceNr_
            + Constants.QUERY_SEPARATOR_CHAR
            + itemNr_
            + Constants.QUERY_ITEM_END_CHAR);

    if (isAvailableForRollback)
      CommonVariables.queryStringBuffer.append(
          Constants.QUERY_SEPARATOR_STRING + "isAvailableForRollback");

    /*		if( isSelectedByQuery )		// Always true during query
    			CommonVariables.queryStringBuffer.append( Constants.QUERY_SEPARATOR_STRING + "isSelectedByQuery" );
    */

    if (wasActiveBeforeArchiving)
      CommonVariables.queryStringBuffer.append(
          Constants.QUERY_SEPARATOR_STRING + "wasActiveBeforeArchiving");

    if (userNr_ > Constants.NO_USER_NR) {
      CommonVariables.queryStringBuffer.append(
          Constants.QUERY_SEPARATOR_STRING
              + "user:"******"original:"
              + Constants.QUERY_DEACTIVE_ITEM_START_CHAR
              + originalSentenceNr_
              + Constants.QUERY_DEACTIVE_ITEM_END_CHAR);

    if (activeSentenceNr_ > Constants.NO_SENTENCE_NR && activeSentenceNr_ != creationSentenceNr_)
      CommonVariables.queryStringBuffer.append(
          Constants.QUERY_SEPARATOR_STRING
              + "active:"
              + Constants.QUERY_DEACTIVE_ITEM_START_CHAR
              + activeSentenceNr_
              + Constants.QUERY_DEACTIVE_ITEM_END_CHAR);

    if (deactiveSentenceNr_ > Constants.NO_SENTENCE_NR
        && deactiveSentenceNr_ != creationSentenceNr_)
      CommonVariables.queryStringBuffer.append(
          Constants.QUERY_SEPARATOR_STRING
              + "deactive:"
              + Constants.QUERY_DEACTIVE_ITEM_START_CHAR
              + deactiveSentenceNr_
              + Constants.QUERY_DEACTIVE_ITEM_END_CHAR);

    if (archiveSentenceNr_ > Constants.NO_SENTENCE_NR)
      CommonVariables.queryStringBuffer.append(
          Constants.QUERY_SEPARATOR_STRING
              + "archive:"
              + Constants.QUERY_DEACTIVE_ITEM_START_CHAR
              + archiveSentenceNr_
              + Constants.QUERY_DEACTIVE_ITEM_END_CHAR);

    if (deleteSentenceNr_ > Constants.NO_SENTENCE_NR)
      CommonVariables.queryStringBuffer.append(
          Constants.QUERY_SEPARATOR_STRING
              + "delete:"
              + Constants.QUERY_DEACTIVE_ITEM_START_CHAR
              + deleteSentenceNr_
              + Constants.QUERY_DEACTIVE_ITEM_END_CHAR);

    return CommonVariables.queryStringBuffer;
  }