Interface FloatVector

All Superinterfaces:
org.apache.lucene.util.Accountable, AutoCloseable, Closeable, org.elasticsearch.core.RefCounted, org.elasticsearch.core.Releasable, Vector
All Known Implementing Classes:
ConstantNullVector, FloatBigArrayVector

public sealed interface FloatVector extends Vector permits FloatBigArrayVector, ConstantNullVector (not exhaustive)
Vector that stores float values. This class is generated. Edit X-Vector.java.st instead.
  • Method Details

    • getFloat

      float getFloat(int position)
    • asBlock

      FloatBlock asBlock()
      Description copied from interface: Vector
      Returns Returns a new Block containing this vector..
      Specified by:
      asBlock in interface Vector
      Returns:
      Returns a new Block containing this vector.
    • filter

      FloatVector filter(int... positions)
      Description copied from interface: Vector
      Creates a new vector that only exposes the positions provided. Materialization of the selected positions is avoided.
      Specified by:
      filter in interface Vector
      Parameters:
      positions - the positions to retain
      Returns:
      a filtered vector
    • keepMask

      FloatBlock keepMask(BooleanVector mask)
      Description copied from interface: Vector
      Build a Block the same values as this Vector, but replacing all values for which mask.getBooleanValue(position) returns false with null. The mask vector must be at least as long as this Vector.
      Specified by:
      keepMask in interface Vector
    • lookup

      org.elasticsearch.core.ReleasableIterator<? extends FloatBlock> lookup(IntBlock positions, ByteSizeValue targetBlockSize)
      Description copied from interface: Vector
      Builds an Iterator of new Blocks with the same Vector.elementType() as this Vector whose values are copied from positions in this Vector. It has the same number of positions as the positions parameter.

      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 ReleasableIterator may retain a reference to the positions parameter. Close it to release those references.

      This block is built using the same BlockFactory as was used to build the positions parameter.

      Specified by:
      lookup in interface Vector
    • equals

      boolean equals(Object obj)
      Compares the given object with this vector for equality. Returns true if and only if the given object is a FloatVector, and both vectors are equal.
      Overrides:
      equals in class Object
    • hashCode

      int hashCode()
      Returns the hash code of this vector, as defined by hash(FloatVector).
      Overrides:
      hashCode in class Object
    • equals

      static boolean equals(FloatVector vector1, FloatVector vector2)
      Returns true if the given vectors are equal to each other, otherwise false. 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 FloatVector interface.
    • hash

      static int hash(FloatVector vector)
      Generates the hash code for the given vector. The hash code is computed from the vector's values. This ensures that vector1.equals(vector2) implies that vector1.hashCode()==vector2.hashCode() for any two vectors, vector1 and vector2, as required by the general contract of Object.hashCode().
    • readFrom

      static FloatVector readFrom(BlockFactory blockFactory, StreamInput in) throws IOException
      Deserializes a Vector from the given stream input.
      Throws:
      IOException
    • writeTo

      default void writeTo(StreamOutput out) throws IOException
      Serializes this Vector to the given stream output.
      Throws:
      IOException