in computer-algorithm/src/main/java/org/apache/hugegraph/computer/algorithm/centrality/degree/DegreeCentrality.java [77:94]
private static double weightValue(Value value) {
if (value == null) {
return 1.0;
}
switch (value.valueType()) {
case LONG:
case INT:
case DOUBLE:
case FLOAT:
return NumericUtil.convertToNumber(value).doubleValue();
default:
throw new ComputerException("The weight property can only be " +
"either Long or Int or Double or " +
"Float, but got %s",
value.valueType());
}
}