Record Class PGVectorPredicate

java.lang.Object
java.lang.Record
org.umlg.sqlg.predicate.PGVectorPredicate
All Implemented Interfaces:
BiPredicate<Double,Double>, org.apache.tinkerpop.gremlin.process.traversal.PBiPredicate<Double,Double>

public record PGVectorPredicate(PGVectorPredicate.QueryType queryType, String operator, float[] vector, boolean[] bitVector, double distance) extends Record implements org.apache.tinkerpop.gremlin.process.traversal.PBiPredicate<Double,Double>
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    PGVectorPredicate(PGVectorPredicate.QueryType queryType, String operator, float[] vector, boolean[] bitVector, double distance)
    Creates an instance of a PGVectorPredicate record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean[]
    Returns the value of the bitVector record component.
    static org.apache.tinkerpop.gremlin.process.traversal.P<Double>
    cosineDistance(float[] vector, double distance)
     
    double
    Returns the value of the distance record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    static org.apache.tinkerpop.gremlin.process.traversal.P<Double>
    hammingDistance(boolean[] vector, double distance)
     
    final int
    Returns a hash code value for this object.
    static org.apache.tinkerpop.gremlin.process.traversal.P<Double>
    innerProduct(float[] vector, double distance)
     
    static org.apache.tinkerpop.gremlin.process.traversal.P<Double>
    jaccardDistance(boolean[] vector, double distance)
     
    static org.apache.tinkerpop.gremlin.process.traversal.P<Double>
    l1Distance(float[] vector, double distance)
     
    static org.apache.tinkerpop.gremlin.process.traversal.P<Double>
    l2Distance(float[] vector, double distance)
     
    Returns the value of the operator record component.
    Returns the value of the queryType record component.
    boolean
    test(Double s, Double s2)
     
    final String
    Returns a string representation of this record class.
    float[]
    Returns the value of the vector record component.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface java.util.function.BiPredicate

    and, or

    Methods inherited from interface org.apache.tinkerpop.gremlin.process.traversal.PBiPredicate

    getPredicateName, negate
  • Constructor Details

    • PGVectorPredicate

      public PGVectorPredicate(PGVectorPredicate.QueryType queryType, String operator, float[] vector, boolean[] bitVector, double distance)
      Creates an instance of a PGVectorPredicate record class.
      Parameters:
      queryType - the value for the queryType record component
      operator - the value for the operator record component
      vector - the value for the vector record component
      bitVector - the value for the bitVector record component
      distance - the value for the distance record component
  • Method Details

    • l2Distance

      public static org.apache.tinkerpop.gremlin.process.traversal.P<Double> l2Distance(float[] vector, double distance)
    • l1Distance

      public static org.apache.tinkerpop.gremlin.process.traversal.P<Double> l1Distance(float[] vector, double distance)
    • innerProduct

      public static org.apache.tinkerpop.gremlin.process.traversal.P<Double> innerProduct(float[] vector, double distance)
    • cosineDistance

      public static org.apache.tinkerpop.gremlin.process.traversal.P<Double> cosineDistance(float[] vector, double distance)
    • hammingDistance

      public static org.apache.tinkerpop.gremlin.process.traversal.P<Double> hammingDistance(boolean[] vector, double distance)
    • jaccardDistance

      public static org.apache.tinkerpop.gremlin.process.traversal.P<Double> jaccardDistance(boolean[] vector, double distance)
    • test

      public boolean test(Double s, Double s2)
      Specified by:
      test in interface BiPredicate<Double,Double>
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • queryType

      public PGVectorPredicate.QueryType queryType()
      Returns the value of the queryType record component.
      Returns:
      the value of the queryType record component
    • operator

      public String operator()
      Returns the value of the operator record component.
      Returns:
      the value of the operator record component
    • vector

      public float[] vector()
      Returns the value of the vector record component.
      Returns:
      the value of the vector record component
    • bitVector

      public boolean[] bitVector()
      Returns the value of the bitVector record component.
      Returns:
      the value of the bitVector record component
    • distance

      public double distance()
      Returns the value of the distance record component.
      Returns:
      the value of the distance record component