Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,35 @@ $else$
$type$ get$Type$(int valueIndex);
$endif$

/**
* Checks if this block has the given value at valueIndex. If at this index we have a
* multivalue, then it returns true if any values match.
*
* @param valueIndex the index at which we should check the value(s)
* @param value the value to check against
*/
default boolean hasValue(int valueIndex, $type$ value) {
final var count = getValueCount(valueIndex);
final var startIndex = getFirstValueIndex(valueIndex);
for (int index = startIndex; index < startIndex + count; index++) {
$if(BytesRef)$
var ref = new BytesRef();
ref = getBytesRef(index, ref);
if (ref.length == 0) {
continue;
}
if (value.equals(ref)) {
return true;
}
$else$
if (value == get$Type$(index)) {
return true;
}
$endif$
}
return false;
}

@Override
$Type$Vector asVector();

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading