本文整理汇总了Java中gnu.trove.TIntHashSet.isEmpty方法的典型用法代码示例。如果您正苦于以下问题:Java TIntHashSet.isEmpty方法的具体用法?Java TIntHashSet.isEmpty怎么用?Java TIntHashSet.isEmpty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gnu.trove.TIntHashSet
的用法示例。
在下文中一共展示了TIntHashSet.isEmpty方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: removeMapping
import gnu.trove.TIntHashSet; //导入方法依赖的package包/类
public void removeMapping(Collection<String> outputPaths, int buildTargetId) throws IOException {
if (outputPaths.isEmpty()) {
return;
}
for (String outputPath : outputPaths) {
final int key = FileUtil.pathHashCode(outputPath);
synchronized (myDataLock) {
final TIntHashSet state = getState(key);
if (state != null) {
final boolean removed = state.remove(buildTargetId);
if (state.isEmpty()) {
remove(key);
}
else {
if (removed) {
update(key, state);
}
}
}
}
}
}
示例2: removeAll
import gnu.trove.TIntHashSet; //导入方法依赖的package包/类
@Override
public void removeAll(int key, TIntHashSet values) {
try {
final TIntHashSet collection = myCache.get(key);
if (collection != NULL_COLLECTION) {
if (collection.removeAll(values.toArray())) {
myCache.remove(key);
if (collection.isEmpty()) {
myMap.remove(key);
}
else {
myMap.put(key, collection);
}
}
}
}
catch (IOException e) {
throw new BuildDataCorruptedException(e);
}
}
示例3: removeFrom
import gnu.trove.TIntHashSet; //导入方法依赖的package包/类
@Override
public void removeFrom(final int key, final int value) {
try {
final TIntHashSet collection = myCache.get(key);
if (collection != NULL_COLLECTION) {
if (collection.remove(value)) {
myCache.remove(key);
if (collection.isEmpty()) {
myMap.remove(key);
}
else {
myMap.put(key, collection);
}
}
}
}
catch (IOException e) {
throw new BuildDataCorruptedException(e);
}
}
示例4: removeAll
import gnu.trove.TIntHashSet; //导入方法依赖的package包/类
@Override
public void removeAll(int key, TIntHashSet values) {
final TIntHashSet collection = myMap.get(key);
if (collection != null) {
values.forEach(new TIntProcedure() {
@Override
public boolean execute(int value) {
collection.remove(value);
return true;
}
});
if (collection.isEmpty()) {
myMap.remove(key);
}
}
}
示例5: StaticRank
import gnu.trove.TIntHashSet; //导入方法依赖的package包/类
public StaticRank(int trainSize, ClassificationScoreDB classification, TIntHashSet categoriesFilter) {
this.trainSize = trainSize;
this.classification = classification;
this.testSize = classification.getDocumentCount();
if (categoriesFilter == null || categoriesFilter.isEmpty()) {
this.categoriesFilter = new TIntHashSet((int) (testSize + testSize * 0.25), (float) 0.75);
for (short i = 0; i < classification.getDocumentScoresAsSet(0).size(); i++) {
this.categoriesFilter.add(i);
}
} else {
this.categoriesFilter = categoriesFilter;
}
}
示例6: replace
import gnu.trove.TIntHashSet; //导入方法依赖的package包/类
@Override
public void replace(int key, TIntHashSet value) {
try {
myCache.remove(key);
if (value == null || value.isEmpty()) {
myMap.remove(key);
}
else {
myMap.put(key, value);
}
}
catch (IOException e) {
throw new BuildDataCorruptedException(e);
}
}
示例7: replace
import gnu.trove.TIntHashSet; //导入方法依赖的package包/类
@Override
public void replace(int key, TIntHashSet value) {
if (value == null || value.isEmpty()) {
myMap.remove(key);
}
else {
myMap.put(key, value);
}
}
示例8: removeFrom
import gnu.trove.TIntHashSet; //导入方法依赖的package包/类
@Override
public void removeFrom(final int key, final int value) {
final TIntHashSet collection = myMap.get(key);
if (collection != null) {
if (collection.remove(value)) {
if (collection.isEmpty()) {
myMap.remove(key);
}
}
}
}
示例9: satisfies
import gnu.trove.TIntHashSet; //导入方法依赖的package包/类
public boolean satisfies(final Usage usage) {
if (usage instanceof AnnotationUsage) {
final AnnotationUsage annotationUsage = (AnnotationUsage)usage;
if (!myType.equals(annotationUsage.myType)) {
return false;
}
boolean argumentsSatisfy = false;
if (myUsedArguments != null) {
final TIntHashSet arguments = new TIntHashSet(myUsedArguments.toArray());
arguments.removeAll(annotationUsage.myUsedArguments.toArray());
argumentsSatisfy = !arguments.isEmpty();
}
boolean targetsSatisfy = false;
if (myUsedTargets != null) {
final Collection<ElemType> targets = EnumSet.copyOf(myUsedTargets);
targets.retainAll(annotationUsage.myUsedTargets);
targetsSatisfy = !targets.isEmpty();
}
return argumentsSatisfy || targetsSatisfy;
}
return false;
}