本文整理汇总了Java中io.airlift.slice.Slice.equals方法的典型用法代码示例。如果您正苦于以下问题:Java Slice.equals方法的具体用法?Java Slice.equals怎么用?Java Slice.equals使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类io.airlift.slice.Slice
的用法示例。
在下文中一共展示了Slice.equals方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: input
import io.airlift.slice.Slice; //导入方法依赖的package包/类
@InputFunction
public static void input(EvaluateClassifierPredictionsState state, @SqlType(StandardTypes.VARCHAR) Slice truth, @SqlType(StandardTypes.VARCHAR) Slice prediction)
{
if (truth.equals(prediction)) {
String key = truth.toStringUtf8();
if (!state.getTruePositives().containsKey(key)) {
state.addMemoryUsage(truth.length() + SIZE_OF_INT);
}
state.getTruePositives().put(key, state.getTruePositives().getOrDefault(key, 0) + 1);
}
else {
String truthKey = truth.toStringUtf8();
String predictionKey = prediction.toStringUtf8();
if (!state.getFalsePositives().containsKey(predictionKey)) {
state.addMemoryUsage(prediction.length() + SIZE_OF_INT);
}
state.getFalsePositives().put(predictionKey, state.getFalsePositives().getOrDefault(predictionKey, 0) + 1);
if (!state.getFalseNegatives().containsKey(truthKey)) {
state.addMemoryUsage(truth.length() + SIZE_OF_INT);
}
state.getFalseNegatives().put(truthKey, state.getFalseNegatives().getOrDefault(truthKey, 0) + 1);
}
}
示例2: equalTo
import io.airlift.slice.Slice; //导入方法依赖的package包/类
@Override
public boolean equalTo(Block leftBlock, int leftPosition, Block rightBlock, int rightPosition)
{
Slice leftValue = leftBlock.getSlice(leftPosition, 0, leftBlock.getLength(leftPosition));
Slice rightValue = rightBlock.getSlice(rightPosition, 0, rightBlock.getLength(rightPosition));
return leftValue.equals(rightValue);
}
示例3: equals
import io.airlift.slice.Slice; //导入方法依赖的package包/类
@ScalarOperator(EQUAL)
@SqlType(StandardTypes.BOOLEAN)
public static boolean equals(@SqlType(StandardTypes.JSON) Slice leftJson, @SqlType(StandardTypes.JSON) Slice rightJson)
{
return leftJson.equals(rightJson);
}
示例4: notEqual
import io.airlift.slice.Slice; //导入方法依赖的package包/类
@ScalarOperator(NOT_EQUAL)
@SqlType(StandardTypes.BOOLEAN)
public static boolean notEqual(@SqlType(StandardTypes.JSON) Slice leftJson, @SqlType(StandardTypes.JSON) Slice rightJson)
{
return !leftJson.equals(rightJson);
}
示例5: equal
import io.airlift.slice.Slice; //导入方法依赖的package包/类
@ScalarOperator(EQUAL)
@SqlType(StandardTypes.BOOLEAN)
public static boolean equal(@SqlType(StandardTypes.VARCHAR) Slice left, @SqlType(StandardTypes.VARCHAR) Slice right)
{
return left.equals(right);
}
示例6: notEqual
import io.airlift.slice.Slice; //导入方法依赖的package包/类
@ScalarOperator(NOT_EQUAL)
@SqlType(StandardTypes.BOOLEAN)
public static boolean notEqual(@SqlType(StandardTypes.VARCHAR) Slice left, @SqlType(StandardTypes.VARCHAR) Slice right)
{
return !left.equals(right);
}
示例7: equal
import io.airlift.slice.Slice; //导入方法依赖的package包/类
@ScalarOperator(EQUAL)
@SqlType(StandardTypes.BOOLEAN)
public static boolean equal(@SqlType(StandardTypes.VARBINARY) Slice left, @SqlType(StandardTypes.VARBINARY) Slice right)
{
return left.equals(right);
}
示例8: notEqual
import io.airlift.slice.Slice; //导入方法依赖的package包/类
@ScalarOperator(NOT_EQUAL)
@SqlType(StandardTypes.BOOLEAN)
public static boolean notEqual(@SqlType(StandardTypes.VARBINARY) Slice left, @SqlType(StandardTypes.VARBINARY) Slice right)
{
return !left.equals(right);
}