本文整理匯總了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();
}
示例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;
}
示例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);
}
示例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);
}
}
示例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();
}
示例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);
}
}
}
示例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);
}
}
}
示例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);
}
}
示例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;
}
示例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()));
}
示例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;
}
}
}
示例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));
}
示例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;
}
示例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);
}
示例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;
}