本文整理汇总了Java中elemental.util.Mappable.at方法的典型用法代码示例。如果您正苦于以下问题:Java Mappable.at方法的具体用法?Java Mappable.at怎么用?Java Mappable.at使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类elemental.util.Mappable
的用法示例。
在下文中一共展示了Mappable.at方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getOffset
import elemental.util.Mappable; //导入方法依赖的package包/类
/**
* Read the offset value stored in the dataset.
*
* @param dataset the dataset
* @return the offset value or -1 if no valid value is found
*/
private static int getOffset(final Mappable dataset) {
final String asString = (String) dataset.at(OFFSET_DATASET_NAME);
if (asString == null) {
return -1;
}
try {
return Integer.parseInt(asString);
} catch (final NumberFormatException e) {
return -1;
}
}
示例2: getLayer
import elemental.util.Mappable; //导入方法依赖的package包/类
/**
* Read the layer value stored in the dataset.
*
* @param dataset the dataset
* @return the layer value or -1 if no valid value is found
*/
private static int getLayer(final Mappable dataset) {
final String asString = (String) dataset.at(LAYER_DATASET_NAME);
if (asString == null) {
return -1;
}
try {
return Integer.parseInt(asString);
} catch (final NumberFormatException e) {
return -1;
}
}
示例3: getLine
import elemental.util.Mappable; //导入方法依赖的package包/类
private static Integer getLine(final EventTarget node) {
if (node instanceof Element) {
final Element element = (Element)node;
final Mappable dataset = element.getDataset();
final String lineAsString = (String)(dataset.at(DATASET_KEY_LINE));
try {
int line = Integer.parseInt(lineAsString);
return line;
} catch (final NumberFormatException e) {
return null;
}
} else {
return null;
}
}
示例4: getType
import elemental.util.Mappable; //导入方法依赖的package包/类
/**
* Read the type value stored in the dataset.
*
* @param dataset the dataset
* @return the type value
*/
private static String getType(final Mappable dataset) {
return (String) dataset.at(TYPE_DATASET_NAME);
}
示例5: getMessage
import elemental.util.Mappable; //导入方法依赖的package包/类
/**
* Read the message value stored in the dataset.
*
* @param dataset the dataset
* @return the message value
*/
private static String getMessage(final Mappable dataset) {
return (String) dataset.at(MESSAGE_DATASET_NAME);
}