本文整理了Java中org.apache.kylin.common.util.Dictionary.getIdFromValueImpl()
方法的一些代码示例,展示了Dictionary.getIdFromValueImpl()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Dictionary.getIdFromValueImpl()
方法的具体详情如下:
包路径:org.apache.kylin.common.util.Dictionary
类名称:Dictionary
方法名:getIdFromValueImpl
暂无
代码示例来源:origin: apache/kylin
final public boolean containsValue(T value) throws IllegalArgumentException {
if (isNullObjectForm(value)) {
return true;
} else {
try {
//if no key found, it will throw exception
getIdFromValueImpl(value, 0);
} catch (IllegalArgumentException e) {
return false;
}
return true;
}
}
代码示例来源:origin: apache/kylin
/**
* Returns the ID integer of given value. In case of not found
* <p>
* - if roundingFlag=0, throw IllegalArgumentException; <br>
* - if roundingFlag<0, the closest smaller ID integer if exist; <br>
* - if roundingFlag>0, the closest bigger ID integer if exist. <br>
* <p>
* The implementation often has cache, thus faster than the byte[] version getIdFromValueBytes()
*
* @throws IllegalArgumentException
* if value is not found in dictionary and rounding is off;
* or if rounding cannot find a smaller or bigger ID
*/
final public int getIdFromValue(T value, int roundingFlag) throws IllegalArgumentException {
if (isNullObjectForm(value))
return nullId();
int id = getIdFromValueImpl(value, roundingFlag);
if (id == -1) {
throw new IllegalArgumentException("Value : " + value + " not exists");
}
return id;
}
代码示例来源:origin: org.apache.kylin/kylin-core-common
final public boolean containsValue(T value) throws IllegalArgumentException {
if (isNullObjectForm(value)) {
return true;
} else {
try {
//if no key found, it will throw exception
getIdFromValueImpl(value, 0);
} catch (IllegalArgumentException e) {
return false;
}
return true;
}
}
代码示例来源:origin: org.apache.kylin/kylin-core-common
/**
* Returns the ID integer of given value. In case of not found
* <p>
* - if roundingFlag=0, throw IllegalArgumentException; <br>
* - if roundingFlag<0, the closest smaller ID integer if exist; <br>
* - if roundingFlag>0, the closest bigger ID integer if exist. <br>
* <p>
* The implementation often has cache, thus faster than the byte[] version getIdFromValueBytes()
*
* @throws IllegalArgumentException
* if value is not found in dictionary and rounding is off;
* or if rounding cannot find a smaller or bigger ID
*/
final public int getIdFromValue(T value, int roundingFlag) throws IllegalArgumentException {
if (isNullObjectForm(value))
return nullId();
int id = getIdFromValueImpl(value, roundingFlag);
if (id == -1) {
throw new IllegalArgumentException("Value : " + value + " not exists");
}
return id;
}
代码示例来源:origin: org.apache.kylin/kylin-common
/**
* Returns the ID integer of given value. In case of not found
* <p>
* - if roundingFlag=0, throw IllegalArgumentException; <br>
* - if roundingFlag<0, the closest smaller ID integer if exist; <br>
* - if roundingFlag>0, the closest bigger ID integer if exist. <br>
* <p>
* The implementation often has cache, thus faster than the byte[] version getIdFromValueBytes()
*
* @throws IllegalArgumentException
* if value is not found in dictionary and rounding is off or
* failed
*/
final public int getIdFromValue(T value, int roundingFlag) throws IllegalArgumentException {
if (isNullObjectForm(value))
return nullId();
else
return getIdFromValueImpl(value, roundingFlag);
}
内容来源于网络,如有侵权,请联系作者删除!