本文整理汇总了Java中gnu.trove.map.hash.TCharObjectHashMap类的典型用法代码示例。如果您正苦于以下问题:Java TCharObjectHashMap类的具体用法?Java TCharObjectHashMap怎么用?Java TCharObjectHashMap使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TCharObjectHashMap类属于gnu.trove.map.hash包,在下文中一共展示了TCharObjectHashMap类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: addInternal
import gnu.trove.map.hash.TCharObjectHashMap; //导入依赖的package包/类
/**
* Private internal method to recursively add the wordPart to the trie structure
*
* @param wordPart Word part to be added to the trie
*/
private int addInternal(TrieNode node, String wordPart, boolean isFullWord, int cost) {
cost += 1;
// LOGGER.debugprintln("\t\t" + this.getClass().getSimpleName() +
// ": adding wordPart: " + wordPart + ", currentCost: " + cost);
int length = wordPart.length();
node.children = (node.children != null) ? node.children : new TCharObjectHashMap<TrieNode>(1, 0.9f);
char c = getChar(wordPart);
TrieNode child = node.children.get(c);
if (child == null) {
child = new TrieNode(c);
node.children.put(c, child);
}
if (length == 1) { // This is the end of the string and not on the root
// node, add a child marker to denote end of suffix
child.isEnd = true;
child.isFullWordEnd = child.isFullWordEnd || isFullWord;
} else {
String subString = getSubstring(wordPart);
cost += addInternal(child, subString, isFullWord, cost);
if (createFullTrie && node.isRootNode()) { // full tree and root node
cost += addInternal(node, subString, false, cost);
}
}
return cost;
}
开发者ID:networkdowntime,项目名称:EmbeddableSearch,代码行数:37,代码来源:Trie.java
示例2: CharHashMapTrieNode
import gnu.trove.map.hash.TCharObjectHashMap; //导入依赖的package包/类
/**
* Creates new instance of {@link CharHashMapTrieNode}.
*/
public CharHashMapTrieNode() {
next = new TCharObjectHashMap<CharHashMapTrieNode<T>>();
}
开发者ID:jmnarloch,项目名称:zuul-trie-matcher-spring-cloud-starter,代码行数:7,代码来源:CharHashMapTrieNode.java
示例3: createMap
import gnu.trove.map.hash.TCharObjectHashMap; //导入依赖的package包/类
public <V> Map<Character, V> createMap() {
return new TCharObjectMapDecorator<V>(new TCharObjectHashMap<V>(0));
}
开发者ID:chrisruffalo,项目名称:stringsearch,代码行数:4,代码来源:DefaultStorageFactory.java
注:本文中的gnu.trove.map.hash.TCharObjectHashMap类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论