toConstant method

int toConstant()

Convert to internal constant value.

Implementation

int toConstant() {
  if (this == VectorDistanceType.euclidean) {
    return OBXVectorDistanceType.Euclidean;
  } else if (this == VectorDistanceType.cosine) {
    return OBXVectorDistanceType.Cosine;
  } else if (this == VectorDistanceType.dotProduct) {
    return OBXVectorDistanceType.DotProduct;
  } else if (this == VectorDistanceType.dotProductNonNormalized) {
    return OBXVectorDistanceType.DotProductNonNormalized;
  } else {
    throw ArgumentError.value(this, "distanceType");
  }
}