Java 类org.apache.lucene.util.IndexableBinaryStringTools 实例源码

项目:search    文件:ICUCollationKeyFilter.java   
@Override
public boolean incrementToken() throws IOException {
  if (input.incrementToken()) {
    char[] termBuffer = termAtt.buffer();
    String termText = new String(termBuffer, 0, termAtt.length());
    collator.getRawCollationKey(termText, reusableKey);
    int encodedLength = IndexableBinaryStringTools.getEncodedLength(
        reusableKey.bytes, 0, reusableKey.size);
    if (encodedLength > termBuffer.length) {
      termAtt.resizeBuffer(encodedLength);
    }
    termAtt.setLength(encodedLength);
    IndexableBinaryStringTools.encode(reusableKey.bytes, 0, reusableKey.size,
        termAtt.buffer(), 0, encodedLength);
    return true;
  } else {
    return false;
  }
}
项目:NYBC    文件:ICUCollationKeyFilter.java   
@Override
public boolean incrementToken() throws IOException {
  if (input.incrementToken()) {
    char[] termBuffer = termAtt.buffer();
    String termText = new String(termBuffer, 0, termAtt.length());
    collator.getRawCollationKey(termText, reusableKey);
    int encodedLength = IndexableBinaryStringTools.getEncodedLength(
        reusableKey.bytes, 0, reusableKey.size);
    if (encodedLength > termBuffer.length) {
      termAtt.resizeBuffer(encodedLength);
    }
    termAtt.setLength(encodedLength);
    IndexableBinaryStringTools.encode(reusableKey.bytes, 0, reusableKey.size,
        termAtt.buffer(), 0, encodedLength);
    return true;
  } else {
    return false;
  }
}
项目:read-open-source-code    文件:ICUCollationKeyFilter.java   
@Override
public boolean incrementToken() throws IOException {
  if (input.incrementToken()) {
    char[] termBuffer = termAtt.buffer();
    String termText = new String(termBuffer, 0, termAtt.length());
    collator.getRawCollationKey(termText, reusableKey);
    int encodedLength = IndexableBinaryStringTools.getEncodedLength(
        reusableKey.bytes, 0, reusableKey.size);
    if (encodedLength > termBuffer.length) {
      termAtt.resizeBuffer(encodedLength);
    }
    termAtt.setLength(encodedLength);
    IndexableBinaryStringTools.encode(reusableKey.bytes, 0, reusableKey.size,
        termAtt.buffer(), 0, encodedLength);
    return true;
  } else {
    return false;
  }
}
项目:read-open-source-code    文件:ICUCollationKeyFilter.java   
@Override
public boolean incrementToken() throws IOException {
  if (input.incrementToken()) {
    char[] termBuffer = termAtt.buffer();
    String termText = new String(termBuffer, 0, termAtt.length());
    collator.getRawCollationKey(termText, reusableKey);
    int encodedLength = IndexableBinaryStringTools.getEncodedLength(
        reusableKey.bytes, 0, reusableKey.size);
    if (encodedLength > termBuffer.length) {
      termAtt.resizeBuffer(encodedLength);
    }
    termAtt.setLength(encodedLength);
    IndexableBinaryStringTools.encode(reusableKey.bytes, 0, reusableKey.size,
        termAtt.buffer(), 0, encodedLength);
    return true;
  } else {
    return false;
  }
}
项目:Maskana-Gestor-de-Conocimiento    文件:ICUCollationKeyFilter.java   
@Override
public boolean incrementToken() throws IOException {
  if (input.incrementToken()) {
    char[] termBuffer = termAtt.buffer();
    String termText = new String(termBuffer, 0, termAtt.length());
    collator.getRawCollationKey(termText, reusableKey);
    int encodedLength = IndexableBinaryStringTools.getEncodedLength(
        reusableKey.bytes, 0, reusableKey.size);
    if (encodedLength > termBuffer.length) {
      termAtt.resizeBuffer(encodedLength);
    }
    termAtt.setLength(encodedLength);
    IndexableBinaryStringTools.encode(reusableKey.bytes, 0, reusableKey.size,
        termAtt.buffer(), 0, encodedLength);
    return true;
  } else {
    return false;
  }
}
项目:lams    文件:CollationKeyFilter.java   
@Override
public boolean incrementToken() throws IOException {
  if (input.incrementToken()) {
    byte[] collationKey = collator.getCollationKey(termAtt.toString()).toByteArray();
    int encodedLength = IndexableBinaryStringTools.getEncodedLength(
        collationKey, 0, collationKey.length);
    termAtt.resizeBuffer(encodedLength);
    termAtt.setLength(encodedLength);
    IndexableBinaryStringTools.encode(collationKey, 0, collationKey.length,
        termAtt.buffer(), 0, encodedLength);
    return true;
  } else {
    return false;
  }
}
项目:search    文件:CollationKeyFilter.java   
@Override
public boolean incrementToken() throws IOException {
  if (input.incrementToken()) {
    byte[] collationKey = collator.getCollationKey(termAtt.toString()).toByteArray();
    int encodedLength = IndexableBinaryStringTools.getEncodedLength(
        collationKey, 0, collationKey.length);
    termAtt.resizeBuffer(encodedLength);
    termAtt.setLength(encodedLength);
    IndexableBinaryStringTools.encode(collationKey, 0, collationKey.length,
        termAtt.buffer(), 0, encodedLength);
    return true;
  } else {
    return false;
  }
}
项目:search    文件:CollationTestBase.java   
/**
 * Convenience method to perform the same function as CollationKeyFilter.
 *  
 * @param keyBits the result from 
 *  collator.getCollationKey(original).toByteArray()
 * @return The encoded collation key for the original String
 * @deprecated only for testing deprecated filters
 */
@Deprecated
protected String encodeCollationKey(byte[] keyBits) {
  // Ensure that the backing char[] array is large enough to hold the encoded
  // Binary String
  int encodedLength = IndexableBinaryStringTools.getEncodedLength(keyBits, 0, keyBits.length);
  char[] encodedBegArray = new char[encodedLength];
  IndexableBinaryStringTools.encode(keyBits, 0, keyBits.length, encodedBegArray, 0, encodedLength);
  return new String(encodedBegArray);
}
项目:NYBC    文件:CollationKeyFilter.java   
@Override
public boolean incrementToken() throws IOException {
  if (input.incrementToken()) {
    byte[] collationKey = collator.getCollationKey(termAtt.toString()).toByteArray();
    int encodedLength = IndexableBinaryStringTools.getEncodedLength(
        collationKey, 0, collationKey.length);
    termAtt.resizeBuffer(encodedLength);
    termAtt.setLength(encodedLength);
    IndexableBinaryStringTools.encode(collationKey, 0, collationKey.length,
        termAtt.buffer(), 0, encodedLength);
    return true;
  } else {
    return false;
  }
}
项目:NYBC    文件:CollationTestBase.java   
/**
 * Convenience method to perform the same function as CollationKeyFilter.
 *  
 * @param keyBits the result from 
 *  collator.getCollationKey(original).toByteArray()
 * @return The encoded collation key for the original String
 * @deprecated only for testing deprecated filters
 */
@Deprecated
protected String encodeCollationKey(byte[] keyBits) {
  // Ensure that the backing char[] array is large enough to hold the encoded
  // Binary String
  int encodedLength = IndexableBinaryStringTools.getEncodedLength(keyBits, 0, keyBits.length);
  char[] encodedBegArray = new char[encodedLength];
  IndexableBinaryStringTools.encode(keyBits, 0, keyBits.length, encodedBegArray, 0, encodedLength);
  return new String(encodedBegArray);
}
项目:read-open-source-code    文件:CollationKeyFilter.java   
@Override
public boolean incrementToken() throws IOException {
  if (input.incrementToken()) {
    byte[] collationKey = collator.getCollationKey(termAtt.toString()).toByteArray();
    int encodedLength = IndexableBinaryStringTools.getEncodedLength(
        collationKey, 0, collationKey.length);
    termAtt.resizeBuffer(encodedLength);
    termAtt.setLength(encodedLength);
    IndexableBinaryStringTools.encode(collationKey, 0, collationKey.length,
        termAtt.buffer(), 0, encodedLength);
    return true;
  } else {
    return false;
  }
}
项目:read-open-source-code    文件:CollationKeyFilter.java   
@Override
public boolean incrementToken() throws IOException {
  if (input.incrementToken()) {
    byte[] collationKey = collator.getCollationKey(termAtt.toString()).toByteArray();
    int encodedLength = IndexableBinaryStringTools.getEncodedLength(
        collationKey, 0, collationKey.length);
    termAtt.resizeBuffer(encodedLength);
    termAtt.setLength(encodedLength);
    IndexableBinaryStringTools.encode(collationKey, 0, collationKey.length,
        termAtt.buffer(), 0, encodedLength);
    return true;
  } else {
    return false;
  }
}
项目:read-open-source-code    文件:CollationKeyFilter.java   
@Override
public boolean incrementToken() throws IOException {
  if (input.incrementToken()) {
    byte[] collationKey = collator.getCollationKey(termAtt.toString()).toByteArray();
    int encodedLength = IndexableBinaryStringTools.getEncodedLength(
        collationKey, 0, collationKey.length);
    termAtt.resizeBuffer(encodedLength);
    termAtt.setLength(encodedLength);
    IndexableBinaryStringTools.encode(collationKey, 0, collationKey.length,
        termAtt.buffer(), 0, encodedLength);
    return true;
  } else {
    return false;
  }
}
项目:Maskana-Gestor-de-Conocimiento    文件:CollationKeyFilter.java   
@Override
public boolean incrementToken() throws IOException {
  if (input.incrementToken()) {
    byte[] collationKey = collator.getCollationKey(termAtt.toString()).toByteArray();
    int encodedLength = IndexableBinaryStringTools.getEncodedLength(
        collationKey, 0, collationKey.length);
    termAtt.resizeBuffer(encodedLength);
    termAtt.setLength(encodedLength);
    IndexableBinaryStringTools.encode(collationKey, 0, collationKey.length,
        termAtt.buffer(), 0, encodedLength);
    return true;
  } else {
    return false;
  }
}
项目:Maskana-Gestor-de-Conocimiento    文件:CollationTestBase.java   
/**
 * Convenience method to perform the same function as CollationKeyFilter.
 *  
 * @param keyBits the result from 
 *  collator.getCollationKey(original).toByteArray()
 * @return The encoded collation key for the original String
 * @deprecated only for testing deprecated filters
 */
@Deprecated
protected String encodeCollationKey(byte[] keyBits) {
  // Ensure that the backing char[] array is large enough to hold the encoded
  // Binary String
  int encodedLength = IndexableBinaryStringTools.getEncodedLength(keyBits, 0, keyBits.length);
  char[] encodedBegArray = new char[encodedLength];
  IndexableBinaryStringTools.encode(keyBits, 0, keyBits.length, encodedBegArray, 0, encodedLength);
  return new String(encodedBegArray);
}