コード例 #1
0
 protected long computeEstimatedMemorySize() {
   long result = 0;
   if (!textArray.isDirect()) result += (Character.SIZE / 8) * textArray.capacity();
   result += (Integer.SIZE / 8) * textIndexArray.length;
   result += (Double.SIZE / 8) * latlonArray.length;
   return result;
 }
コード例 #2
0
 protected PlaceNameChunk createPlaceNameChunk(PlaceNameService service) {
   int numChars = this.textArray.length();
   CharBuffer textBuffer = newCharBuffer(numChars);
   textBuffer.put(this.textArray.toString());
   textBuffer.rewind();
   return new PlaceNameChunk(
       service, textBuffer, this.textIndexArray, this.latlonArray, this.numEntries);
 }
コード例 #3
0
 protected CharSequence getText(int index) {
   int beginIndex = textIndexArray[index];
   int endIndex = (index + 1 < numEntries) ? textIndexArray[index + 1] : textArray.length();
   return this.textArray.subSequence(beginIndex, endIndex);
 }