本文整理匯總了Java中gnu.trove.THashSet.size方法的典型用法代碼示例。如果您正苦於以下問題:Java THashSet.size方法的具體用法?Java THashSet.size怎麽用?Java THashSet.size使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類gnu.trove.THashSet
的用法示例。
在下文中一共展示了THashSet.size方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: defaultIntersection
import gnu.trove.THashSet; //導入方法依賴的package包/類
public static VarSet defaultIntersection (VarSet v1, VarSet v2)
{// Grossly inefficient implementation
THashSet hset = new THashSet (v1);
hset.retainAll (v2);
Variable[] ret = new Variable [hset.size ()];
int vai = 0;
for (int vi = 0; vi < v1.size(); vi++) {
Variable var = v1.get (vi);
if (hset.contains (var)) { ret[vai++] = var; }
}
return new HashVarSet (ret);
}
示例2: inlineSameArguments
import gnu.trove.THashSet; //導入方法依賴的package包/類
private void inlineSameArguments(PsiMethod method, List<PsiExpression> copies, InputVariables variables, List<Match> duplicates) {
final List<VariableData> variableDatum = variables.getInputVariables();
final Map<PsiVariable, PsiExpression> toInline = new HashMap<PsiVariable, PsiExpression>();
final int strongParamsCound = method.getParameterList().getParametersCount();
for (int i = strongParamsCound; i < variableDatum.size(); i++) {
VariableData variableData = variableDatum.get(i);
final THashSet<PsiExpression> map = new THashSet<PsiExpression>(ourEquivalenceStrategy);
if (!collectParamValues(duplicates, variableData, map)) {
continue;
}
final PsiExpression currentExpression = copies.get(i - strongParamsCound);
map.add(currentExpression);
if (map.size() == 1) {
toInline.put(variableData.variable, currentExpression);
}
}
if (!toInline.isEmpty()) {
copies.removeAll(toInline.values());
inlineArgumentsInMethodBody(toInline);
removeRedundantParametersFromMethodSignature(toInline);
}
removeUnusedStongParams(strongParamsCound);
}
示例3: endTransaction
import gnu.trove.THashSet; //導入方法依賴的package包/類
public void endTransaction() {
super.endTransaction();
final THashSet<PsiFile> map = filesToScan;
if (map.size() > 0) map.clear();
filesToScan = filesToScan2;
filesToScan2 = map;
}