@Override public boolean equals(Object other) { if (other == null) { return false; } if (other instanceof BytesRef) { return this.bytesEquals((BytesRef) other); } return false; }
private boolean equals(int id, BytesRef b) { pool.setBytesRef(scratch1, bytesStart[id]); return scratch1.bytesEquals(b); }
uidIter.term().bytesEquals(buid)) {
private boolean sameSurfaceForm(BytesRef key, BytesRef output2) { if (hasPayloads) { // output2 has at least PAYLOAD_SEP byte: if (key.length >= output2.length) { return false; } for(int i=0;i<key.length;i++) { if (key.bytes[key.offset+i] != output2.bytes[output2.offset+i]) { return false; } } return output2.bytes[output2.offset + key.length] == payloadSep; } else { return key.bytesEquals(output2); } }
@Override public boolean equals(Object other) { if (this == other) { return true; } if (other instanceof BytesReference) { final BytesReference otherRef = (BytesReference) other; if (length() != otherRef.length()) { return false; } return compareIterators(this, otherRef, (a, b) -> a.bytesEquals(b) ? 0 : 1 // this is a call to BytesRef#bytesEquals - this method is the hot one in the comparison ) == 0; } return false; }
/** * Get the id associated with <code>key</code> */ public long find(BytesRef key, int code) { final long slot = slot(rehash(code), mask); for (long index = slot; ; index = nextSlot(index, mask)) { final long id = id(index); if (id == -1L || key.bytesEquals(get(id, spare))) { return id; } } }
@Override public void nextToken() throws IOException { this.fillBytesRef(result); if (posIncAttr.getPositionIncrement() > 0 && result.get().bytesEquals(candidate.term)) { BytesRef term = result.toBytesRef(); // We should not use frequency(term) here because it will analyze the term again // If preFilter and postFilter are the same analyzer it would fail. long freq = internalFrequency(term); candidates.add(new Candidate(result.toBytesRef(), freq, candidate.stringDistance, score(candidate.frequency, candidate.stringDistance, dictSize), false)); } else { candidates.add(new Candidate(result.toBytesRef(), candidate.frequency, nonErrorLikelihood, score(candidate.frequency, candidate.stringDistance, dictSize), false)); } } }, spare);
in.read(uuid.bytes, uuid.offset, uuid.length); final BytesRef expectedUUID = new BytesRef(translogUUID); if (uuid.bytesEquals(expectedUUID) == false) { throw new TranslogCorruptedException( path.toString(),
@Override public boolean equals(Object other) { if (other == null) { return false; } if (other instanceof BytesRef) { return this.bytesEquals((BytesRef) other); } return false; }
private long set(BytesRef key, int code, long id) { assert rehash(key.hashCode()) == code; assert size < maxSize; final long slot = slot(code, mask); for (long index = slot; ; index = nextSlot(index, mask)) { final long curId = id(index); if (curId == -1) { // means unset id(index, id); append(id, key, code); ++size; return id; } else if (key.bytesEquals(get(curId, spare))) { return -1 - curId; } } }
@Override public boolean equals(Object other) { if (other == null) { return false; } if (other instanceof BytesRef) { return this.bytesEquals((BytesRef) other); } return false; }
@Override public boolean equals(Object other) { if (other == null) { return false; } if (other instanceof BytesRef) { return this.bytesEquals((BytesRef) other); } return false; }
@Override public boolean equals(Object _other) { FieldAndTerm other = (FieldAndTerm) _other; return other.field.equals(field) && term.bytesEquals(other.term); }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; ScoreTerm other = (ScoreTerm) obj; if (term == null) { if (other.term != null) return false; } else if (!term.bytesEquals(other.term)) return false; return true; } }
private boolean isSameIndex(Object value, String indexName) { if (value instanceof BytesRef) { BytesRef indexNameRef = new BytesRef(indexName); return (indexNameRef.bytesEquals((BytesRef) value)); } else { return indexName.equals(value.toString()); } }
private boolean isSameIndex(Object value, String indexName) { if (value instanceof BytesRef) { BytesRef indexNameRef = new BytesRef(indexName); return (indexNameRef.bytesEquals((BytesRef) value)); } else { return indexName.equals(value.toString()); } }
/** * Get the id associated with <code>key</code> */ public long find(BytesRef key, int code) { final long slot = slot(rehash(code), mask); for (long index = slot; ; index = nextSlot(index, mask)) { final long id = id(index); if (id == -1L || key.bytesEquals(get(id, spare))) { return id; } } }
/** * Get the id associated with <code>key</code> */ public long find(BytesRef key, int code) { final long slot = slot(rehash(code), mask); for (long index = slot; ; index = nextSlot(index, mask)) { final long id = id(index); if (id == -1L || key.bytesEquals(get(id, spare))) { return id; } } }
/** * Get the id associated with <code>key</code> */ public long find(BytesRef key, int code) { final long slot = slot(rehash(code), mask); for (long index = slot; ; index = nextSlot(index, mask)) { final long id = id(index); if (id == -1L || key.bytesEquals(get(id, spare))) { return id; } } }
/** * Get the id associated with <code>key</code> */ public long find(BytesRef key, int code) { final long slot = slot(rehash(code), mask); for (long index = slot; ; index = nextSlot(index, mask)) { final long id = id(index); if (id == -1L || key.bytesEquals(get(id, spare))) { return id; } } }