本文整理汇总了Java中gnu.trove.TIntObjectHashMap.keys方法的典型用法代码示例。如果您正苦于以下问题:Java TIntObjectHashMap.keys方法的具体用法?Java TIntObjectHashMap.keys怎么用?Java TIntObjectHashMap.keys使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gnu.trove.TIntObjectHashMap
的用法示例。
在下文中一共展示了TIntObjectHashMap.keys方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: save
import gnu.trove.TIntObjectHashMap; //导入方法依赖的package包/类
public void save(@NotNull final DataOutput dataOutput, TIntObjectHashMap<TIntArrayList> classAndMethodsMap)
throws IOException {
DataInputOutputUtil.writeINT(dataOutput, classAndMethodsMap.size());
final int[] classNameIds = classAndMethodsMap.keys();
Arrays.sort(classNameIds);
int prevClassNameId = 0;
for(int classNameId:classNameIds) {
DataInputOutputUtil.writeINT(dataOutput, classNameId - prevClassNameId);
TIntArrayList value = classAndMethodsMap.get(classNameId);
DataInputOutputUtil.writeINT(dataOutput, value.size());
final int[] methodNameIds = value.toNativeArray();
Arrays.sort(methodNameIds);
int prevMethodNameId = 0;
for (int methodNameId : methodNameIds) {
DataInputOutputUtil.writeINT(dataOutput, methodNameId - prevMethodNameId);
prevMethodNameId = methodNameId;
}
prevClassNameId = classNameId;
}
}
示例2: runTest
import gnu.trove.TIntObjectHashMap; //导入方法依赖的package包/类
private static void runTest(int nameCount, String name) throws InterruptedException, ExecutionException {
System.out.println("----- " + name + " ------ name count: "+nameCount);
TIntObjectHashMap<CharSequence> map = generateNames(nameCount);
final int[] ids = map.keys();
checkNames(map, ids);
warmUp(ids);
measureAverageTime(ids, 1, LONG_RANDOM_ACCESS);
measureAverageTime(ids, 4, LONG_RANDOM_ACCESS);
measureAverageTime(ids, 1, LONG_RANDOM_ACCESS_WITH_GET_PATH);
measureAverageTime(ids, 4, LONG_RANDOM_ACCESS_WITH_GET_PATH);
measureAverageTime(ids, 1, LINEAR_SCAN_AND_RANDOM_ACCESS_WITH_GET_PATH);
measureAverageTime(ids, 4, LINEAR_SCAN_AND_RANDOM_ACCESS_WITH_GET_PATH);
}
示例3: testKObjectMapCloneDoesNotDependOnTheSource
import gnu.trove.TIntObjectHashMap; //导入方法依赖的package包/类
public void testKObjectMapCloneDoesNotDependOnTheSource() {
TIntObjectHashMap<int[]> map = new TIntObjectHashMap<int[]>();
map.put(0, new int[2]);
map.put(1, new int[2]);
TIntObjectHashMap<int[]> clone = map.clone();
assertEquals(clone.size(), 2);
int[] keys = clone.keys();
assertEquals(keys.length, 2);
assertEquals(ContainerUtil.newHashSet(0,1), ContainerUtil.newHashSet(keys[0],keys[1]));
map.clear();
assertEquals(clone.size(), 2);
keys = clone.keys();
assertEquals(keys.length, 2);
assertEquals(ContainerUtil.newHashSet(0,1), ContainerUtil.newHashSet(keys[0],keys[1]));
}
示例4: OneLabelL2PRConstraints
import gnu.trove.TIntObjectHashMap; //导入方法依赖的package包/类
protected OneLabelL2PRConstraints(TIntObjectHashMap<OneLabelPRConstraint> constraints,
TIntIntHashMap constraintIndices, StateLabelMap map, boolean normalized) {
this.constraints = new TIntObjectHashMap<OneLabelPRConstraint>();
for (int key : constraints.keys()) {
this.constraints.put(key, constraints.get(key).copy());
}
//this.constraints = constraints;
this.constraintIndices = constraintIndices;
this.map = map;
this.cache = new TIntArrayList();
this.normalized = normalized;
}
示例5: OneLabelL2IndPRConstraints
import gnu.trove.TIntObjectHashMap; //导入方法依赖的package包/类
protected OneLabelL2IndPRConstraints(TIntObjectHashMap<OneLabelL2IndPRConstraint> constraints,
StateLabelMap map, boolean normalized) {
this.normalized = normalized;
this.numDimensions = 0;
// copy constraints
this.constraints = new TIntObjectHashMap<OneLabelL2IndPRConstraint>();
for (int key : constraints.keys()) {
this.constraints.put(key, constraints.get(key).copy());
numDimensions += constraints.get(key).getNumConstrainedLabels();
}
this.map = map;
this.cache = new TIntArrayList();
}
示例6: computeProperties
import gnu.trove.TIntObjectHashMap; //导入方法依赖的package包/类
private static Properties computeProperties(final Matcher matcher, final TIntObjectHashMap<String> offsetToProperty, Project project) {
Properties properties = new Properties(FileTemplateManager.getInstance(project).getDefaultProperties());
int[] offsets = offsetToProperty.keys();
Arrays.sort(offsets);
for (int i = 0; i < offsets.length; i++) {
final int offset = offsets[i];
String propName = offsetToProperty.get(offset);
int groupNum = i + 2; // first group is whole doc comment
String propValue = matcher.group(groupNum);
properties.setProperty(propName, propValue);
}
return properties;
}
示例7: templateToRegex
import gnu.trove.TIntObjectHashMap; //导入方法依赖的package包/类
private static String templateToRegex(String text, TIntObjectHashMap<String> offsetToProperty, Project project) {
List<Object> properties = ContainerUtil.newArrayList(FileTemplateManager.getInstance(project).getDefaultProperties().keySet());
properties.add("PACKAGE_NAME");
String regex = escapeRegexChars(text);
// first group is a whole file header
int groupNumber = 1;
for (Object property : properties) {
String name = property.toString();
String escaped = escapeRegexChars("${" + name + "}");
boolean first = true;
for (int i = regex.indexOf(escaped); i != -1 && i < regex.length(); i = regex.indexOf(escaped, i + 1)) {
String replacement = first ? "([^\\n]*)" : "\\" + groupNumber;
int delta = escaped.length() - replacement.length();
int[] offs = offsetToProperty.keys();
for (int off : offs) {
if (off > i) {
String prop = offsetToProperty.remove(off);
offsetToProperty.put(off - delta, prop);
}
}
offsetToProperty.put(i, name);
regex = regex.substring(0, i) + replacement + regex.substring(i + escaped.length());
if (first) {
groupNumber++;
first = false;
}
}
}
return regex;
}
示例8: keys2
import gnu.trove.TIntObjectHashMap; //导入方法依赖的package包/类
public int[] keys2 (int key1)
{
TIntObjectHashMap inner = (TIntObjectHashMap) backing.get (key1);
return inner.keys ();
}