@Override protected long decode(BytesRef scratch, ByteArrayDataInput tmpInput) { scratch.length -= 4; // int // skip suggestion: tmpInput.reset(scratch.bytes, scratch.offset+scratch.length, 4); return tmpInput.readInt(); } }
analyzed.setLength(analyzedLength); long cost = input.readInt();
@Override protected long decode(BytesRef scratch, ByteArrayDataInput tmpInput) { tmpInput.reset(scratch.bytes); tmpInput.skipBytes(scratch.length - 4); // suggestion + separator scratch.length -= 5; // sep + long return tmpInput.readInt(); } }
@Override public int compare(BytesRef a, BytesRef b) { reader.reset(a.bytes, a.offset, a.length); final int xa = reader.readInt(); final int ya = reader.readInt(); final int za = reader.readInt(); final int docIDA = reader.readVInt(); final long ordA = reader.readVLong(); final int xb = reader.readInt(); final int yb = reader.readInt(); final int zb = reader.readInt(); final int docIDB = reader.readVInt(); final long ordB = reader.readVLong();
@Override public int compare(BytesRef a, BytesRef b) { reader.reset(a.bytes, a.offset, a.length); final int latAEnc = reader.readInt(); final int lonAEnc = reader.readInt(); final int docIDA = reader.readVInt(); final long ordA = reader.readVLong(); reader.reset(b.bytes, b.offset, b.length); final int latBEnc = reader.readInt(); final int lonBEnc = reader.readInt(); final int docIDB = reader.readVInt(); final long ordB = reader.readVLong(); int cmp; if (lon) { cmp = Integer.compare(lonAEnc, lonBEnc); } else { cmp = Integer.compare(latAEnc, latBEnc); } if (cmp != 0) { return cmp; } // Tie-break cmp = Integer.compare(docIDA, docIDB); if (cmp != 0) { return cmp; } return Long.compare(ordA, ordB); } };
break; case Type.WHITESPACE_TEXT: alpha[i] = in.readInt(); break; case Type.PARENT_POINTER:
while (reader.read(tmp1)) { input.reset(tmp1.bytes); int currentScore = input.readInt();
while (reader.read(tmp1)) { input.reset(tmp1.bytes()); int currentScore = input.readInt();
analyzed.setLength(analyzedLength); long cost = input.readInt();
analyzed.setLength(analyzedLength); long cost = input.readInt();
analyzed.setLength(analyzedLength); long cost = input.readInt();
analyzed.setLength(analyzedLength); long cost = input.readInt();