本文整理汇总了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;
}
开发者ID:universal-automata,项目名称:liblevenshtein-java,代码行数:24,代码来源:ProtobufSerializer.java
示例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();
}
开发者ID:Diorite,项目名称:Diorite-old,代码行数:10,代码来源:CharMapCraftingRecipePatternImpl.java
示例3: getIngredients
import it.unimi.dsi.fastutil.chars.Char2ObjectMap; //导入依赖的package包/类
@Override
public Char2ObjectMap<CraftingRecipeItem> getIngredients()
{
return this.items;
}
开发者ID:Diorite,项目名称:Diorite-old,代码行数:6,代码来源:CharMapCraftingRecipePatternImpl.java
示例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();
开发者ID:Diorite,项目名称:Diorite-old,代码行数:7,代码来源:CharMapCraftingRecipePattern.java
示例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);
}
开发者ID:universal-automata,项目名称:liblevenshtein-java,代码行数:9,代码来源:FinalDawgNode.java
注:本文中的it.unimi.dsi.fastutil.chars.Char2ObjectMap类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论