本文整理汇总了Java中gnu.trove.TIntHashSet.remove方法的典型用法代码示例。如果您正苦于以下问题:Java TIntHashSet.remove方法的具体用法?Java TIntHashSet.remove怎么用?Java TIntHashSet.remove使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gnu.trove.TIntHashSet
的用法示例。
在下文中一共展示了TIntHashSet.remove方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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);
}
}
示例3: read
import gnu.trove.TIntHashSet; //导入方法依赖的package包/类
public TIntArrayList read(@NotNull DataInput dataInput) throws IOException {
TIntHashSet result = new TIntHashSet();
while (((InputStream)dataInput).available() > 0) {
int id = DataInputOutputUtil.readINT(dataInput);
if (REMOVED_MARKER == id) {
id = DataInputOutputUtil.readINT(dataInput);
result.remove(id);
}
else {
result.add(id);
}
}
return new TIntArrayList(result.toArray());
}
示例4: 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);
}
}
}
}
示例5: removeOccurence
import gnu.trove.TIntHashSet; //导入方法依赖的package包/类
public void removeOccurence(int key, int value) {
if (mySingle.containsKey(key)) {
mySingle.remove(key);
return;
}
TIntHashSet items = myMulti.get(key);
if (items != null) {
items.remove(value);
if (items.size() == 1) {
mySingle.put(key, items.toArray()[0]);
myMulti.remove(key);
}
}
}