當前位置: 首頁>>代碼示例>>Java>>正文


Java Set.remove方法代碼示例

本文整理匯總了Java中java.util.Set.remove方法的典型用法代碼示例。如果您正苦於以下問題:Java Set.remove方法的具體用法?Java Set.remove怎麽用?Java Set.remove使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在java.util.Set的用法示例。


在下文中一共展示了Set.remove方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onClick

import java.util.Set; //導入方法依賴的package包/類
public void onClick(View v) {
    finalHolder.model.checked = !finalHolder.model.checked;
    finalHolder.checkbox.setChecked(finalHolder.model.checked);

    // Make a copy of the set to work around an Android bug: https://code.google.com/p/android/issues/detail?id=27801#c2
    final Set<String> selected = new HashSet<>(SunagoUtil.getPreferences().getStringSet(
            Sunago.getAppContext().getString(R.string.twitter_selected_lists), new HashSet<>()));
    final SharedPreferences.Editor editor = SunagoUtil.getPreferences().edit();

    if (finalHolder.model.checked) {
        selected.add(String.valueOf(finalHolder.model.userList.getId()));
    } else {
        selected.remove(String.valueOf(finalHolder.model.userList.getId()));
    }
    editor.putStringSet(Sunago.getAppContext().getString(R.string.twitter_selected_lists), selected);
    editor.commit();
}
 
開發者ID:PacktPublishing,項目名稱:Java-9-Programming-Blueprints,代碼行數:18,代碼來源:UserListAdapter.java

示例2: getMergeQuery

import java.util.Set; //導入方法依賴的package包/類
private String getMergeQuery(OracleTable table, Set<String> columnAliasSet, NodeGroup node) {
	MergeQueryBuilder builder = MergeQueryBuilder.getBuilder();
	SQLFilters mergeFilter = null;
	for (OracleColumn keyColumn : table.getKeyColumns()) {
		if (mergeFilter == null) {
			mergeFilter = SQLFilters.getFilter(Operations.eq(keyColumn, null));
		} else {
			mergeFilter.AND(Operations.eq(keyColumn, null));
		}
	}
	String mergeQuery = builder.merge().into(table).usingDual().on(mergeFilter).getMergeQuery(columnAliasSet);
	for (Map.Entry<String, ColumnAttrMapper> mapper : node.getColumnAttrMappers().entrySet()) {
		if (mapper.getValue().isSeqGenerated()) {
			mergeQuery = mergeQuery.replace(QueryConstants.COLON + mapper.getKey(),
					mapper.getValue().getSeqName() + QueryConstants.NEXTVAL);
			columnAliasSet.remove(mapper.getKey());
		}
	}
	logger.info(mergeQuery);
	return mergeQuery;
}
 
開發者ID:gagoyal01,項目名稱:mongodb-rdbms-sync,代碼行數:22,代碼來源:MngToOrclSyncWriter.java

示例3: updateErrorsInFile

import java.util.Set; //導入方法依賴的package包/類
private static void updateErrorsInFile(
    @NonNull final Callback callback,
    @NonNull final FileObject root,
    @NonNull final FileObject file) {
    final List<Task> tasks = new ArrayList<Task>();
    for (WhiteListIndex.Problem problem : WhiteListIndex.getDefault().getWhiteListViolations(root, file)) {
        final Map.Entry<FileObject,List<? extends Task>> task = createTask(problem);
        if (task != null) {
            tasks.addAll(task.getValue());
        }
    }
    final Set<FileObject> filesWithErrors = getFilesWithAttachedErrors(root);
    if (tasks.isEmpty()) {
        filesWithErrors.remove(file);
    } else {
        filesWithErrors.add(file);
    }
    LOG.log(Level.FINE, "setting {1} for {0}", new Object[]{file, tasks});
    callback.setTasks(file, tasks);
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:21,代碼來源:WhiteListTaskProvider.java

示例4: sessionEnd

import java.util.Set; //導入方法依賴的package包/類
/**
 * {@inheritDoc}
 */
@Override
public void sessionEnd(boolean commit) throws CacheWriterException {
    Transaction transaction = session.transaction();
    if (transaction == null) {
        return;
    }
    Map<Object, Object> properties = session.properties();
    if (!commit) {
        Map bigBuffer = (Map) properties.get(BUFFER_PROPERTY_NAME);
        if (bigBuffer != null) {
            bigBuffer.remove(cacheName);
        }
    }
    Set<String> caches = (Set<String>) properties.get(CACHES_PROPERTY_NAME);
    if (caches != null && caches.remove(cacheName) && caches.isEmpty()) {
        Map<String, Collection<Cache.Entry<?, ?>>> buffer =
                (Map<String, Collection<Cache.Entry<?, ?>>>) properties.get(BUFFER_PROPERTY_NAME);
        notifyListeners(nextTransactionId(), buffer);
    }
}
 
開發者ID:epam,項目名稱:Lagerta,代碼行數:24,代碼來源:DataCapturerBus.java

示例5: removeActivityInfo

import java.util.Set; //導入方法依賴的package包/類
void removeActivityInfo(String stubActivityName, ActivityInfo targetInfo) {
    targetActivityInfos.remove(targetInfo.name);
    //remove form map
    if (stubActivityName == null) {
        for (Set<ActivityInfo> set : activityInfosMap.values()) {
            set.remove(targetInfo);
        }
    } else {
        Set<ActivityInfo> list = activityInfosMap.get(stubActivityName);
        if (list != null) {
            list.remove(targetInfo);
        }
    }
    updatePkgs();
}
 
開發者ID:amikey,項目名稱:DroidPlugin,代碼行數:16,代碼來源:RunningProcesList.java

示例6: unsubscribe

import java.util.Set; //導入方法依賴的package包/類
public void unsubscribe(URL url, NotifyListener listener) {
    if (! Constants.ANY_VALUE.equals(url.getServiceInterface())
            && url.getParameter(Constants.REGISTER_KEY, true)) {
        unregister(url);
    }
    String client = RpcContext.getContext().getRemoteAddressString();
    Map<URL, Set<NotifyListener>> clientListeners = remoteSubscribed.get(client);
    if (clientListeners != null && clientListeners.size() > 0) {
        Set<NotifyListener> listeners = clientListeners.get(url);
        if (listeners != null && listeners.size() > 0) {
            listeners.remove(listener);
        }
    }
}
 
開發者ID:yunhaibin,項目名稱:dubbox-hystrix,代碼行數:15,代碼來源:SimpleRegistryService.java

示例7: updateReferenceColumns

import java.util.Set; //導入方法依賴的package包/類
private static void updateReferenceColumns(Column col, boolean isReadOnly, final Set<Column> allCols, final Set<Column> modifiedCols, final Set<Column> readOnlyCols) {
    allCols.add(col);
    if (modifiedCols != null) {
        assert (readOnlyCols != null);
        if (isReadOnly) {
            if (modifiedCols.contains(col) == false)
                readOnlyCols.add(col);
        } else {
            readOnlyCols.remove(col);
            modifiedCols.add(col);
        }
    }
}
 
開發者ID:s-store,項目名稱:s-store,代碼行數:14,代碼來源:CatalogUtil.java

示例8: removeBreakpoint

import java.util.Set; //導入方法依賴的package包/類
/**
 * Removes the given {@link DSLBreakpoint}.
 * 
 * @param breakpoint
 *            the {@link DSLBreakpoint}
 */
protected void removeBreakpoint(DSLBreakpoint breakpoint) {
	Set<DSLBreakpoint> brkps = breakpoints.get(breakpoint.getURI());
	if (brkps != null) {
		brkps.remove(breakpoint);
	}
}
 
開發者ID:eclipse,項目名稱:gemoc-studio-modeldebugging,代碼行數:13,代碼來源:DSLLabelDecorator.java

示例9: computeMultimapAsMapGetFeatures

import java.util.Set; //導入方法依賴的package包/類
Set<Feature<?>> computeMultimapAsMapGetFeatures(Set<Feature<?>> multimapFeatures) {
  Set<Feature<?>> derivedFeatures =
      Helpers.copyToSet(computeMultimapGetFeatures(multimapFeatures));
  if (derivedFeatures.remove(CollectionSize.ANY)) {
    derivedFeatures.addAll(CollectionSize.ANY.getImpliedFeatures());
  }
  derivedFeatures.remove(CollectionSize.ZERO);
  return derivedFeatures;
}
 
開發者ID:zugzug90,項目名稱:guava-mock,代碼行數:10,代碼來源:MultimapTestSuiteBuilder.java

示例10: entityMustNotExistInDatabase

import java.util.Set; //導入方法依賴的package包/類
private void entityMustNotExistInDatabase() {
	Object idFieldValue = this.entityReference.valueMap().get(this.idFieldName);
	// TODO: der wert ovn idFieldValue darf in den pre-execution required data nicht vorkommen
	Set<DatabaseObject> data = this.vm.getVirtualObjectDatabase().getPreExecutionRequiredData().get(this.entityName);
	data.remove(this.entityReference);
	ReferenceVariable oldRefVar = (ReferenceVariable) this.frame.getOperandStack().pop();
	this.frame.getOperandStack().push(new ObjectNullRef(oldRefVar.getInitializedClass()));
}
 
開發者ID:wwu-pi,項目名稱:tap17-muggl-javaee,代碼行數:9,代碼來源:EntityManagerFindChoicePoint2.java

示例11: removeClassInstructor

import java.util.Set; //導入方法依賴的package包/類
/**
 * Remove class from instructor list
 * @param ci
 */
public void removeClassInstructor(ClassInstructor classInstr) {
	Set s = this.getClasses();
	for (Iterator iter = s.iterator(); iter.hasNext();) {
		ClassInstructor ci = (ClassInstructor) iter.next();
		if (ci.getUniqueId().intValue() == classInstr.getUniqueId()
				.intValue()) {
			s.remove(ci);
			break;
		}
	}
}
 
開發者ID:Jenner4S,項目名稱:unitimes,代碼行數:16,代碼來源:DepartmentalInstructor.java

示例12: should_create_job_after_gitlab_push_webhook_trigger

import java.util.Set; //導入方法依賴的package包/類
@Test
public void should_create_job_after_gitlab_push_webhook_trigger() throws Throwable {
    init_flow("[email protected]:yang.guo/for-testing.git");

    MockHttpServletRequestBuilder push = post("/hooks/git/" + flowName)
        .contentType(MediaType.APPLICATION_JSON)
        .content(getResourceContent("gitlab/push_payload.json"))
        .header("x-gitlab-event", "Push Hook");

    Job job = mock_trigger_from_git(push);
    job = jobDao.get(job.getId());

    Set<String> envKeySet = Sets.newHashSet(ObjectUtil.deepCopy(EnvKey.FOR_OUTPUTS));
    envKeySet.remove(GitEnvs.FLOW_GIT_PR_URL.name());
    verifyRootNodeResultOutput(job, envKeySet);

    Assert.assertEquals(GitSource.UNDEFINED_SSH.name(), job.getEnv(GitEnvs.FLOW_GIT_SOURCE));
    Assert.assertEquals(GitEventType.PUSH.name(), job.getEnv(GitEnvs.FLOW_GIT_EVENT_TYPE));
    Assert.assertEquals(GitSource.GITLAB.name(), job.getEnv(GitEnvs.FLOW_GIT_EVENT_SOURCE));

    Assert.assertEquals("Update .flow.yml for gitlab", job.getEnv(GitEnvs.FLOW_GIT_CHANGELOG.name()));
    Assert.assertEquals("develop", job.getEnv(GitEnvs.FLOW_GIT_BRANCH));
    Assert.assertEquals("yang.guo", job.getEnv(GitEnvs.FLOW_GIT_AUTHOR));
    Assert.assertEquals("[email protected]l.com", job.getEnv(GitEnvs.FLOW_GIT_AUTHOR_EMAIL));
    Assert.assertEquals("2d9b3a080c8fb653686cd56ccf8c0a6b50ba47d3", job.getEnv(GitEnvs.FLOW_GIT_COMMIT_ID));
    Assert.assertEquals(
        "https://gitlab.com/yang.guo/for-testing/commit/2d9b3a080c8fb653686cd56ccf8c0a6b50ba47d3",
        job.getEnv(GitEnvs.FLOW_GIT_COMMIT_URL));
    Assert.assertEquals("c9ca9280a567...2d9b3a080c8f", job.getEnv(GitEnvs.FLOW_GIT_COMPARE_ID));
    Assert.assertEquals(
        "https://gitlab.com/yang.guo/for-testing/compare/c9ca9280a567...2d9b3a080c8f",
        job.getEnv(GitEnvs.FLOW_GIT_COMPARE_URL));
}
 
開發者ID:FlowCI,項目名稱:flow-platform,代碼行數:34,代碼來源:GitWebhookTest.java

示例13: skipDuringInitialization

import java.util.Set; //導入方法依賴的package包/類
/**
 * When many members are started concurrently, it is possible that an accessor or non-version
 * generating replicate receives CreateRegionMessage before it is initialized, thus preventing
 * persistent members from starting. We skip compatibilityChecks if the region is not
 * initialized, and let other members check compatibility. If all members skipCompatabilit
 * checks, then the CreateRegionMessage should be retried. fixes #45186
 */
private boolean skipDuringInitialization(CacheDistributionAdvisee rgn) {
  boolean skip = false;
  if (rgn instanceof LocalRegion) {
    LocalRegion lr = (LocalRegion) rgn;
    if (!lr.isInitialized()) {
      Set recipients = new CreateRegionProcessor(rgn).getRecipients();
      recipients.remove(getSender());
      if (!recipients.isEmpty()) {
        skip = true;
      }
    }
  }
  return skip;
}
 
開發者ID:ampool,項目名稱:monarch,代碼行數:22,代碼來源:CreateRegionProcessor.java

示例14: getDefaultAllowedConfigs

import java.util.Set; //導入方法依賴的package包/類
@TargetApi(Build.VERSION_CODES.O)
private static Set<Bitmap.Config> getDefaultAllowedConfigs() {
  Set<Bitmap.Config> configs = new HashSet<>();
  configs.addAll(Arrays.asList(Bitmap.Config.values()));
  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
    // GIFs, among other types, end up with a native Bitmap config that doesn't map to a java
    // config and is treated as null in java code. On KitKat+ these Bitmaps can be reconfigured
    // and are suitable for re-use.
    configs.add(null);
  }
  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
    configs.remove(Bitmap.Config.HARDWARE);
  }
  return Collections.unmodifiableSet(configs);
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:16,代碼來源:LruBitmapPool.java

示例15: getTrimmedStringCollection

import java.util.Set; //導入方法依賴的package包/類
/**
 * Splits a comma separated value <code>String</code>, trimming leading and trailing whitespace on each value.
 * Duplicate and empty values are removed.
 * @param str a comma separated <String> with values
 * @return a <code>Collection</code> of <code>String</code> values
 */
public static Collection<String> getTrimmedStringCollection(String str){
  Set<String> set = new LinkedHashSet<String>(
    Arrays.asList(getTrimmedStrings(str)));
  set.remove("");
  return set;
}
 
開發者ID:naver,項目名稱:hadoop,代碼行數:13,代碼來源:StringUtils.java


注:本文中的java.util.Set.remove方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。