- All Superinterfaces:
org.apache.lucene.util.Accountable,AutoCloseable,Closeable,org.elasticsearch.core.RefCounted,org.elasticsearch.core.Releasable,Vector
- All Known Implementing Classes:
BooleanBigArrayVector,ConstantNullVector
public sealed interface BooleanVector
extends Vector
permits BooleanBigArrayVector, ConstantNullVector (not exhaustive)
Vector that stores boolean values.
This class is generated. Edit
X-Vector.java.st instead.-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceA builder that grows as needed.static interfaceA builder that never grows. -
Field Summary
Fields inherited from interface org.apache.lucene.util.Accountable
NULL_ACCOUNTABLEFields inherited from interface org.elasticsearch.core.RefCounted
ALWAYS_REFERENCEDFields inherited from interface org.elasticsearch.compute.data.Vector
SERIALIZE_VECTOR_ARRAY, SERIALIZE_VECTOR_BIG_ARRAY, SERIALIZE_VECTOR_CONSTANT, SERIALIZE_VECTOR_ORDINAL, SERIALIZE_VECTOR_VALUES -
Method Summary
Modifier and TypeMethodDescriptionbooleanallFalse()Are all valuesfalse? This will scan all values to check and always answer accurately.booleanallTrue()Are all valuestrue? This will scan all values to check and always answer accurately.asBlock()Returns Returns a new Block containing this vector..booleanCompares the given object with this vector for equality.static booleanequals(BooleanVector vector1, BooleanVector vector2) Returnstrueif the given vectors are equal to each other, otherwisefalse.filter(int... positions) Creates a new vector that only exposes the positions provided.booleangetBoolean(int position) static inthash(BooleanVector vector) Generates the hash code for the given vector.inthashCode()Returns the hash code of this vector, as defined byhash(BooleanVector).keepMask(BooleanVector mask) org.elasticsearch.core.ReleasableIterator<? extends BooleanBlock> lookup(IntBlock positions, ByteSizeValue targetBlockSize) Builds an Iterator of newBlocks with the sameVector.elementType()as thisVectorwhose values are copied from positions in this Vector.static BooleanVectorreadFrom(BlockFactory blockFactory, StreamInput in) Deserializes a Vector from the given stream input.default voidwriteTo(StreamOutput out) Serializes this Vector to the given stream output.Methods inherited from interface org.apache.lucene.util.Accountable
getChildResources, ramBytesUsedMethods inherited from interface org.elasticsearch.core.RefCounted
decRef, hasReferences, incRef, mustIncRef, tryIncRefMethods inherited from interface org.elasticsearch.core.Releasable
closeMethods inherited from interface org.elasticsearch.compute.data.Vector
allowPassingToDifferentDriver, blockFactory, elementType, getPositionCount, isConstant, isReleased
-
Method Details
-
getBoolean
boolean getBoolean(int position) -
asBlock
BooleanBlock asBlock()Description copied from interface:VectorReturns Returns a new Block containing this vector.. -
filter
Description copied from interface:VectorCreates a new vector that only exposes the positions provided. Materialization of the selected positions is avoided. -
keepMask
Description copied from interface:Vector -
lookup
org.elasticsearch.core.ReleasableIterator<? extends BooleanBlock> lookup(IntBlock positions, ByteSizeValue targetBlockSize) Description copied from interface:VectorBuilds an Iterator of newBlocks with the sameVector.elementType()as thisVectorwhose values are copied from positions in this Vector. It has the same number ofpositionsas thepositionsparameter.For example, if this vector contained
[a, b, c]and were called with the block[0, 1, 1, [1, 2]]then the result would be[a, b, b, [b, c]].This process produces
count(positions)values per positions which could be quite large. Instead of returning a single Block, this returns an Iterator of Blocks containing all of the promised values.The returned
ReleasableIteratormay retain a reference to thepositionsparameter. Close it to release those references.This block is built using the same
BlockFactoryas was used to build thepositionsparameter. -
allTrue
boolean allTrue()Are all valuestrue? This will scan all values to check and always answer accurately. -
allFalse
boolean allFalse()Are all valuesfalse? This will scan all values to check and always answer accurately. -
equals
Compares the given object with this vector for equality. Returnstrueif and only if the given object is a BooleanVector, and both vectors areequal. -
hashCode
int hashCode()Returns the hash code of this vector, as defined byhash(BooleanVector). -
equals
Returnstrueif the given vectors are equal to each other, otherwisefalse. Two vectors are considered equal if they have the same position count, and contain the same values in the same order. This definition ensures that the equals method works properly across different implementations of the BooleanVector interface. -
hash
Generates the hash code for the given vector. The hash code is computed from the vector's values. This ensures thatvector1.equals(vector2)implies thatvector1.hashCode()==vector2.hashCode()for any two vectors,vector1andvector2, as required by the general contract ofObject.hashCode(). -
readFrom
Deserializes a Vector from the given stream input.- Throws:
IOException
-
writeTo
Serializes this Vector to the given stream output.- Throws:
IOException
-