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)));
 }
  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;
  }