- All Superinterfaces:
org.apache.lucene.util.Accountable,AutoCloseable,Closeable,org.elasticsearch.core.RefCounted,org.elasticsearch.core.Releasable,Vector
- All Known Implementing Classes:
ConstantNullVector,IntBigArrayVector
public sealed interface IntVector
extends Vector
permits IntBigArrayVector, ConstantNullVector (not exhaustive)
Vector that stores int 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 TypeMethodDescriptionasBlock()Returns Returns a new Block containing this vector..booleanCompares the given object with this vector for equality.static booleanReturnstrueif the given vectors are equal to each other, otherwisefalse.filter(int... positions) Creates a new vector that only exposes the positions provided.intgetInt(int position) static intGenerates the hash code for the given vector.inthashCode()Returns the hash code of this vector, as defined byhash(IntVector).keepMask(BooleanVector mask) org.elasticsearch.core.ReleasableIterator<? extends IntBlock> lookup(IntBlock positions, ByteSizeValue targetBlockSize) Builds an Iterator of newBlocks with the sameVector.elementType()as thisVectorwhose values are copied from positions in this Vector.intmax()The maximum value in the Vector.intmin()The minimum value in the Vector.static IntVectorrange(int startInclusive, int endExclusive, BlockFactory blockFactory) Create a vector for a range of ints.static IntVectorreadFrom(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
-
getInt
int getInt(int position) -
asBlock
IntBlock 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 IntBlock> 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. -
min
int min()The minimum value in the Vector. An empty Vector will returnInteger.MAX_VALUE. -
max
int max()The maximum value in the Vector. An empty Vector will returnInteger.MIN_VALUE. -
equals
Compares the given object with this vector for equality. Returnstrueif and only if the given object is a IntVector, and both vectors areequal. -
hashCode
int hashCode()Returns the hash code of this vector, as defined byhash(IntVector). -
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 IntVector 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
-
range
Create a vector for a range of ints.
-