当前位置: 首页>>代码示例>>Java>>正文


Java ToStringUtils类代码示例

本文整理汇总了Java中org.apache.lucene.util.ToStringUtils的典型用法代码示例。如果您正苦于以下问题:Java ToStringUtils类的具体用法?Java ToStringUtils怎么用?Java ToStringUtils使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ToStringUtils类属于org.apache.lucene.util包,在下文中一共展示了ToStringUtils类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: toString

import org.apache.lucene.util.ToStringUtils; //导入依赖的package包/类
@Override
public String toString(String field) {
  StringBuilder buffer = new StringBuilder();
  buffer.append("spanOr([");
  Iterator<SpanQuery> i = clauses.iterator();
  while (i.hasNext()) {
    SpanQuery clause = i.next();
    buffer.append(clause.toString(field));
    if (i.hasNext()) {
      buffer.append(", ");
    }
  }
  buffer.append("])");
  buffer.append(ToStringUtils.boost(getBoost()));
  return buffer.toString();
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:17,代码来源:SpanOrQuery.java

示例2: toString

import org.apache.lucene.util.ToStringUtils; //导入依赖的package包/类
@Override
public String toString(String field) {
  StringBuilder buffer = new StringBuilder();
  buffer.append("spanNear([");
  Iterator<SpanQuery> i = clauses.iterator();
  while (i.hasNext()) {
    SpanQuery clause = i.next();
    buffer.append(clause.toString(field));
    if (i.hasNext()) {
      buffer.append(", ");
    }
  }
  buffer.append("], ");
  buffer.append(slop);
  buffer.append(", ");
  buffer.append(inOrder);
  buffer.append(")");
  buffer.append(ToStringUtils.boost(getBoost()));
  return buffer.toString();
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:21,代码来源:SpanNearQuery.java

示例3: toString

import org.apache.lucene.util.ToStringUtils; //导入依赖的package包/类
/** Prints a user-readable version of this query. */
@Override
public String toString(String field) {
    StringBuilder buffer = new StringBuilder();
    if (!getField().equals(field)) {
        buffer.append(getField());
        buffer.append(":");
    }
    buffer.append(includeLower ? '[' : '{');
    // TODO: all these toStrings for queries should just output the bytes, it might not be UTF-8!
    buffer.append(lowerTerm != null ? ("*".equals(Term.toString(lowerTerm)) ? "\\*" : Term.toString(lowerTerm))  : "*");
    buffer.append(" TO ");
    buffer.append(upperTerm != null ? ("*".equals(Term.toString(upperTerm)) ? "\\*" : Term.toString(upperTerm)) : "*");
    buffer.append(includeUpper ? ']' : '}');
    buffer.append(ToStringUtils.boost(getBoost()));
    return buffer.toString();
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:18,代码来源:TermRangeQuery.java

示例4: toString

import org.apache.lucene.util.ToStringUtils; //导入依赖的package包/类
@Override
public String toString(String field) {
  StringBuilder buffer = new StringBuilder();
  buffer.append("payloadNear([");
  Iterator<SpanQuery> i = clauses.iterator();
  while (i.hasNext()) {
    SpanQuery clause = i.next();
    buffer.append(clause.toString(field));
    if (i.hasNext()) {
      buffer.append(", ");
    }
  }
  buffer.append("], ");
  buffer.append(slop);
  buffer.append(", ");
  buffer.append(inOrder);
  buffer.append(")");
  buffer.append(ToStringUtils.boost(getBoost()));
  return buffer.toString();
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:21,代码来源:PayloadNearQuery.java

示例5: toString

import org.apache.lucene.util.ToStringUtils; //导入依赖的package包/类
@Override
public String toString() {
  StringBuilder s = new StringBuilder("EliasFanoSequence");
  s.append(" numValues " + numValues);
  s.append(" numEncoded " + numEncoded);
  s.append(" upperBound " + upperBound);
  s.append(" lastEncoded " + lastEncoded);
  s.append(" numLowBits " + numLowBits);
  s.append("\nupperLongs[" + upperLongs.length + "]");
  for (int i = 0; i < upperLongs.length; i++) {
    s.append(" " + ToStringUtils.longHex(upperLongs[i]));
  }
  s.append("\nlowerLongs[" + lowerLongs.length + "]");
  for (int i = 0; i < lowerLongs.length; i++) {
    s.append(" " + ToStringUtils.longHex(lowerLongs[i]));
  }
  s.append("\nindexInterval: " + indexInterval + ", nIndexEntryBits: " + nIndexEntryBits);
  s.append("\nupperZeroBitPositionIndex[" + upperZeroBitPositionIndex.length + "]");
  for (int i = 0; i < upperZeroBitPositionIndex.length; i++) { 
    s.append(" " + ToStringUtils.longHex(upperZeroBitPositionIndex[i]));
  }
  return s.toString();
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:24,代码来源:EliasFanoEncoder.java

示例6: toString

import org.apache.lucene.util.ToStringUtils; //导入依赖的package包/类
@Override
public String toString(String field) {
    StringBuilder builder = new StringBuilder("blended(terms:[");
    for (int i = 0; i < terms.length; ++i) {
        builder.append(terms[i]);
        float boost = 1f;
        if (boosts != null) {
            boost = boosts[i];
        }
        builder.append(ToStringUtils.boost(boost));
        builder.append(", ");
    }
    if (terms.length > 0) {
        builder.setLength(builder.length() - 2);
    }
    builder.append("])");
    builder.append(ToStringUtils.boost(getBoost()));
    return builder.toString();
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:20,代码来源:BlendedTermQuery.java

示例7: toString

import org.apache.lucene.util.ToStringUtils; //导入依赖的package包/类
@Override
public String toString (String field) {
    StringBuilder sb = new StringBuilder();
    if (sourceClass > 0) {
        sb.append("{");
        sb.append(sourceClass);
        sb.append(": source:");
    }
    if (targetClass > 0) {
        sb.append("{");
        sb.append(targetClass);
        sb.append(": target:");
    }
    sb.append("spanRelation(");
    sb.append(firstClause.toString(field));
    sb.append(")");
    if (sourceClass > 0) {
        sb.append("}");
    }
    if (targetClass > 0) {
        sb.append("}");
    }
    sb.append(ToStringUtils.boost(getBoost()));
    return sb.toString();
}
 
开发者ID:KorAP,项目名称:Krill,代码行数:26,代码来源:SpanRelationQuery.java

示例8: toString

import org.apache.lucene.util.ToStringUtils; //导入依赖的package包/类
@Override
public String toString (String field) {
    StringBuffer buffer = new StringBuffer();
    buffer.append("focus(");
    if (matchTemporaryClass) {
        buffer.append("#");
    }
    if (classNumbers.size() > 1) {
        buffer.append("[");
        for (int i = 0; i < classNumbers.size(); i++) {
            buffer.append((short) classNumbers.get(i) & 0xFF);
            if (i != classNumbers.size() - 1) {
                buffer.append(",");
            }
        }
        buffer.append("]");
    }
    else {
        buffer.append((short) classNumbers.get(0) & 0xFF).append(": ");
    }
    buffer.append(this.firstClause.toString());
    buffer.append(')');
    buffer.append(ToStringUtils.boost(getBoost()));
    return buffer.toString();
}
 
开发者ID:KorAP,项目名称:Krill,代码行数:26,代码来源:SpanFocusQuery.java

示例9: toString

import org.apache.lucene.util.ToStringUtils; //导入依赖的package包/类
@Override
public String toString (String field) {
    StringBuilder sb = new StringBuilder();
    sb.append(this.spanName);
    sb.append("(");
    sb.append(firstClause.toString(field));
    sb.append(", ");
    sb.append(secondClause.toString(field));
    sb.append(", ");
    sb.append("[(");
    sb.append(distanceUnit);
    sb.append("[");
    sb.append(minDistance);
    sb.append(":");
    sb.append(maxDistance);
    sb.append("], ");
    sb.append(isOrdered ? "ordered, " : "notOrdered, ");
    sb.append(exclusion ? "excluded)])" : "notExcluded)])");
    sb.append(ToStringUtils.boost(getBoost()));
    return sb.toString();
}
 
开发者ID:KorAP,项目名称:Krill,代码行数:22,代码来源:SpanDistanceQuery.java

示例10: toString

import org.apache.lucene.util.ToStringUtils; //导入依赖的package包/类
/** Prints a user-readable version of this query. */
@Override
public String toString(String field) {
    StringBuilder buffer = new StringBuilder();
    if (!getField().equals(field)) {
        buffer.append(getField());
        buffer.append(":");
    }
    buffer.append(includeLower ? '[' : '{');
    buffer.append(lowerTerm != null ? lowerTerm : "*");
    buffer.append(" TO ");
    buffer.append(upperTerm != null ? upperTerm : "*");
    buffer.append(includeUpper ? ']' : '}');
    buffer.append(ToStringUtils.boost(getBoost()));
    return buffer.toString();
}
 
开发者ID:europeana,项目名称:search,代码行数:17,代码来源:SlowCollatedTermRangeQuery.java

示例11: toString

import org.apache.lucene.util.ToStringUtils; //导入依赖的package包/类
@Override
public String toString(String field) {
  StringBuilder buffer = new StringBuilder();
  boolean needParens = (getBoost() != 1.0)
      || (getMinimumNumberShouldMatch() > 0);
  if (needParens) {
    buffer.append("(");
  }
  for (int i = 0; i < terms.size(); i++) {
    Term t = terms.get(i);
    buffer.append(new TermQuery(t).toString());
    
    if (i != terms.size() - 1) buffer.append(", ");
  }
  if (needParens) {
    buffer.append(")");
  }
  if (getMinimumNumberShouldMatch() > 0) {
    buffer.append('~');
    buffer.append(getMinimumNumberShouldMatch());
  }
  if (getBoost() != 1.0f) {
    buffer.append(ToStringUtils.boost(getBoost()));
  }
  return buffer.toString();
}
 
开发者ID:pkarmstr,项目名称:NYBC,代码行数:27,代码来源:CommonTermsQuery.java

示例12: toString

import org.apache.lucene.util.ToStringUtils; //导入依赖的package包/类
/** Prints a user-readable version of this query. */
@Override
public String toString(String field) {
    StringBuilder buffer = new StringBuilder();
    if (!getField().equals(field)) {
        buffer.append(getField());
        buffer.append(":");
    }
    buffer.append(includeLower ? '[' : '{');
    // TODO: all these toStrings for queries should just output the bytes, it might not be UTF-8!
    buffer.append(lowerTerm != null ? ("*".equals(lowerTerm.utf8ToString()) ? "\\*" : lowerTerm.utf8ToString())  : "*");
    buffer.append(" TO ");
    buffer.append(upperTerm != null ? ("*".equals(upperTerm.utf8ToString()) ? "\\*" : upperTerm.utf8ToString()) : "*");
    buffer.append(includeUpper ? ']' : '}');
    buffer.append(ToStringUtils.boost(getBoost()));
    return buffer.toString();
}
 
开发者ID:pkarmstr,项目名称:NYBC,代码行数:18,代码来源:TermRangeQuery.java

示例13: toString

import org.apache.lucene.util.ToStringUtils; //导入依赖的package包/类
/** Prints a user-readable version of this query. */
public String toString(String field) {
  StringBuffer buffer = new StringBuffer();
  if (!term.field().equals(field)) {
    buffer.append(term.field());
    buffer.append(":");
  }
  buffer.append(term.text());
  buffer.append(ToStringUtils.boost(getBoost()));
  return buffer.toString();
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:12,代码来源:TermQuery.java

示例14: toString

import org.apache.lucene.util.ToStringUtils; //导入依赖的package包/类
/** Prints a user-readable version of this query. */
@Override
public String toString(String field) {
  StringBuilder buffer = new StringBuilder();
  if (!term.field().equals(field)) {
    buffer.append(term.field());
    buffer.append(":");
  }
  buffer.append(term.text());
  buffer.append(ToStringUtils.boost(getBoost()));
  return buffer.toString();
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:13,代码来源:TermQuery.java

示例15: toString

import org.apache.lucene.util.ToStringUtils; //导入依赖的package包/类
@Override
public String toString(final String field) {
  final StringBuilder sb = new StringBuilder();
  if (!getField().equals(field)) sb.append(getField()).append(':');
  return sb.append(minInclusive ? '[' : '{')
    .append((min == null) ? "*" : min.toString())
    .append(" TO ")
    .append((max == null) ? "*" : max.toString())
    .append(maxInclusive ? ']' : '}')
    .append(ToStringUtils.boost(getBoost()))
    .toString();
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:13,代码来源:NumericRangeQuery.java


注:本文中的org.apache.lucene.util.ToStringUtils类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。