Example usage for org.apache.lucene.util CharsRef EMPTY_CHARS

List of usage examples for org.apache.lucene.util CharsRef EMPTY_CHARS

Introduction

In this page you can find the example usage for org.apache.lucene.util CharsRef EMPTY_CHARS.

Prototype

null EMPTY_CHARS

To view the source code for org.apache.lucene.util CharsRef EMPTY_CHARS.

Click Source Link

Document

An empty character array for convenience

Usage

From source file:elhuyar.bilakit.Dictionary.java

License:Apache License

static char[] decodeFlags(BytesRef b) {
      if (b.length == 0) {
          return CharsRef.EMPTY_CHARS;
      }//from  w  w w  .  j av a 2s  . co  m
      int len = b.length >>> 1;
      char flags[] = new char[len];
      int upto = 0;
      int end = b.offset + b.length;
      for (int i = b.offset; i < end; i += 2) {
          flags[upto++] = (char) ((b.bytes[i] << 8) | (b.bytes[i + 1] & 0xff));
      }
      return flags;
  }

From source file:stemmer.Dictionary.java

License:Apache License

static char[] decodeFlags(BytesRef b) {
    if (b.length == 0) {
        return CharsRef.EMPTY_CHARS;
    }// w ww.  j  a  v  a 2 s.c  o  m
    int len = b.length >>> 1;
    char flags[] = new char[len];
    int upto = 0;
    int end = b.offset + b.length;
    for (int i = b.offset; i < end; i += 2) {
        flags[upto++] = (char) ((b.bytes[i] << 8) | (b.bytes[i + 1] & 0xff));
    }
    return flags;
}