本文整理汇总了Java中it.unimi.dsi.fastutil.chars.Char2ObjectMap类的典型用法代码示例。如果您正苦于以下问题:Java Char2ObjectMap类的具体用法?Java Char2ObjectMap怎么用?Java Char2ObjectMap使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Char2ObjectMap类属于it.unimi.dsi.fastutil.chars包,在下文中一共展示了Char2ObjectMap类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: protoOf
import it.unimi.dsi.fastutil.chars.Char2ObjectMap; //导入依赖的package包/类
/**
* Returns the prototype of a node.
* @param node Node whose prototype is to be returned.
* @param nodes Mapping of {@link DawgNode}s to
* {@link LibLevenshteinProtos.DawgNode}s, to avoid constructing a full trie.
* @return The prototype of the node.
*/
protected LibLevenshteinProtos.DawgNode protoOf(
final DawgNode node,
final Map<DawgNode, LibLevenshteinProtos.DawgNode> nodes) {
if (nodes.containsKey(node)) {
return nodes.get(node);
}
final LibLevenshteinProtos.DawgNode.Builder builder =
LibLevenshteinProtos.DawgNode.newBuilder();
builder.setIsFinal(node.isFinal());
for (final Char2ObjectMap.Entry<DawgNode> edge : node.edges().char2ObjectEntrySet()) {
builder.addEdge(protoOf(edge.getCharKey(), edge.getValue(), nodes));
}
final LibLevenshteinProtos.DawgNode proto = builder.build();
nodes.put(node, proto);
return proto;
}
示例2: CharMapCraftingRecipePatternImpl
import it.unimi.dsi.fastutil.chars.Char2ObjectMap; //导入依赖的package包/类
public CharMapCraftingRecipePatternImpl(final Char2ObjectMap<CraftingRecipeItem> items, final String[] pattern)
{
Validate.notNull(pattern, "Recipe pattern can't be null.");
Validate.notEmpty(pattern, "Recipe pattern can't be empty.");
Validate.noNullElements(pattern, "Recipe pattern elements can't be null.");
Validate.notNull(items, "Recipe pattern items can't be null.");
this.items = Char2ObjectMaps.unmodifiable(new Char2ObjectOpenHashMap<>(items));
this.pattern = pattern.clone();
}
示例3: getIngredients
import it.unimi.dsi.fastutil.chars.Char2ObjectMap; //导入依赖的package包/类
@Override
public Char2ObjectMap<CraftingRecipeItem> getIngredients()
{
return this.items;
}
示例4: getIngredients
import it.unimi.dsi.fastutil.chars.Char2ObjectMap; //导入依赖的package包/类
/**
* Returns ingredients used by this pattern.
*
* @return ingredients used by this pattern.
*/
Char2ObjectMap<CraftingRecipeItem> getIngredients();
示例5: FinalDawgNode
import it.unimi.dsi.fastutil.chars.Char2ObjectMap; //导入依赖的package包/类
/**
* Constructs a new {@link FinalDawgNode}, which acts just like a
* {@link DawgNode} except that {@link #isFinal()} returns true.
* @param edges Outgoing edges of this node.
*/
public FinalDawgNode(final Char2ObjectMap<DawgNode> edges) {
super(edges);
}