日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 >

java版本的getorcreate_Java ContainerUtil.getOrCreate方法代碼示例

發(fā)布時(shí)間:2025/3/21 27 豆豆
生活随笔 收集整理的這篇文章主要介紹了 java版本的getorcreate_Java ContainerUtil.getOrCreate方法代碼示例 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

本文整理匯總了Java中com.intellij.util.containers.ContainerUtil.getOrCreate方法的典型用法代碼示例。如果您正苦於以下問題:Java ContainerUtil.getOrCreate方法的具體用法?Java ContainerUtil.getOrCreate怎麼用?Java ContainerUtil.getOrCreate使用的例子?那麼恭喜您, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進(jìn)一步了解該方法所在類com.intellij.util.containers.ContainerUtil的用法示例。

在下文中一共展示了ContainerUtil.getOrCreate方法的7個(gè)代碼示例,這些例子默認(rèn)根據(jù)受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點(diǎn)讚,您的評(píng)價(jià)將有助於我們的係統(tǒng)推薦出更棒的Java代碼示例。

示例1: increment

?點(diǎn)讚 3

?

import com.intellij.util.containers.ContainerUtil; //導(dǎo)入方法依賴的package包/類

public synchronized void increment(@NotNull String groupName,

@NotNull NotificationSource source,

@NotNull NotificationCategory category,

@NotNull ProjectSystemId projectSystemId) {

final TObjectIntHashMap counter =

ContainerUtil.getOrCreate(

ContainerUtil.getOrCreate(

ContainerUtil.getOrCreate(

map,

projectSystemId,

ContainerUtil.>>newHashMap()),

groupName,

ContainerUtil.>newHashMap()

),

source,

new MyTObjectIntHashMap()

);

if (!counter.increment(category)) counter.put(category, 1);

}

開發(fā)者ID:jskierbi,項(xiàng)目名稱:intellij-ce-playground,代碼行數(shù):21,

示例2: remove

?點(diǎn)讚 3

?

import com.intellij.util.containers.ContainerUtil; //導(dǎo)入方法依賴的package包/類

public synchronized void remove(@Nullable final String groupName,

@NotNull final NotificationSource notificationSource,

@NotNull final ProjectSystemId projectSystemId) {

final Map>> groupMap =

ContainerUtil.getOrCreate(

map,

projectSystemId,

ContainerUtil.>>newHashMap());

if (groupName != null) {

final TObjectIntHashMap counter = ContainerUtil.getOrCreate(

ContainerUtil.getOrCreate(

groupMap,

groupName,

ContainerUtil.>newHashMap()

),

notificationSource,

new MyTObjectIntHashMap()

);

counter.clear();

}

else {

for (Map> sourceMap : groupMap.values()) {

sourceMap.remove(notificationSource);

}

}

}

開發(fā)者ID:jskierbi,項(xiàng)目名稱:intellij-ce-playground,代碼行數(shù):27,

示例3: getState

?點(diǎn)讚 3

?

import com.intellij.util.containers.ContainerUtil; //導(dǎo)入方法依賴的package包/類

public Map> getState() {

final Map> result = ContainerUtil.newHashMap();

Consumer consumer = new Consumer() {

@Override

public void consume(PostfixTemplateCheckedTreeNode template) {

if (!template.isChecked()) {

Set templatesForLanguage =

ContainerUtil.getOrCreate(result, template.getLang(), PostfixTemplatesSettings.SET_FACTORY);

templatesForLanguage.add(template.getTemplate().getKey());

}

}

};

visit(consumer);

return result;

}

開發(fā)者ID:jskierbi,項(xiàng)目名稱:intellij-ce-playground,代碼行數(shù):17,

示例4: checkList

?點(diǎn)讚 3

?

import com.intellij.util.containers.ContainerUtil; //導(dǎo)入方法依賴的package包/類

@NotNull

public SvnMergeInfoCache.MergeCheckResult checkList(@NotNull final SvnChangeList list, final String branchPath) {

synchronized (myCalculatedLock) {

SvnMergeInfoCache.MergeCheckResult result;

final long revision = calculateCopyRevision(branchPath);

if (revision != -1 && revision >= list.getNumber()) {

result = SvnMergeInfoCache.MergeCheckResult.COMMON;

}

else {

result = ContainerUtil.getOrCreate(myAlreadyCalculatedMap, list.getNumber(), new Factory() {

@Override

public SvnMergeInfoCache.MergeCheckResult create() {

return checkAlive(list, branchPath);

}

});

}

return result;

}

}

開發(fā)者ID:jskierbi,項(xiàng)目名稱:intellij-ce-playground,代碼行數(shù):20,

示例5: createFileProvider

?點(diǎn)讚 2

?

import com.intellij.util.containers.ContainerUtil; //導(dǎo)入方法依賴的package包/類

@NotNull

private static ISVNStatusFileProvider createFileProvider(@NotNull Map nonRecursiveMap) {

final Map> result = ContainerUtil.newHashMap();

for (SvnScopeZipper.MyDirNonRecursive item : nonRecursiveMap.values()) {

File file = item.getDir().getIOFile();

Map fileMap = ContainerUtil.getOrCreate(result, file.getAbsolutePath(), NAME_TO_FILE_MAP_FACTORY);

for (FilePath path : item.getChildrenList()) {

fileMap.put(path.getName(), path.getIOFile());

}

// also add currently processed file to the map of its parent, as there are cases when SVNKit calls ISVNStatusFileProvider with file

// parent (and not file that was passed to doStatus()), gets null result and does not provide any status

// see http://issues.tmatesoft.com/issue/SVNKIT-567 for details

if (file.getParentFile() != null) {

Map parentMap = ContainerUtil.getOrCreate(result, file.getParentFile().getAbsolutePath(), NAME_TO_FILE_MAP_FACTORY);

parentMap.put(file.getName(), file);

}

}

return new ISVNStatusFileProvider() {

@Override

public Map getChildrenFiles(File parent) {

return result.get(parent.getAbsolutePath());

}

};

}

開發(fā)者ID:jskierbi,項(xiàng)目名稱:intellij-ce-playground,代碼行數(shù):30,

示例6: getChildren

?點(diǎn)讚 2

?

import com.intellij.util.containers.ContainerUtil; //導(dǎo)入方法依賴的package包/類

@NotNull

@Override

public Collection extends AbstractTreeNode> getChildren() {

final ServerConnection> connection = getConnection();

if (connection == null) {

return Collections.emptyList();

}

Map group2node = new HashMap();

final List children = new ArrayList();

for (Deployment deployment : connection.getDeployments()) {

final String groupName = deployment.getGroup();

if (groupName == null) {

children.add(new DeploymentNodeImpl(connection, this, deployment));

}

else {

Map groups

= ContainerUtil.getOrCreate(myServer2DeploymentGroups, getServer(), new Factory>() {

@Override

public Map create() {

return new HashMap();

}

});

final DeploymentGroup group

= ContainerUtil.getOrCreate(groups, groupName, new Factory() {

@Override

public DeploymentGroup create() {

return new DeploymentGroup(groupName);

}

});

ContainerUtil.getOrCreate(group2node, group, new Factory() {

@Override

public GroupNode create() {

GroupNode result = new GroupNode(connection, RemoteServerNode.this, group);

children.add(result);

return result;

}

});

}

}

return children;

}

開發(fā)者ID:jskierbi,項(xiàng)目名稱:intellij-ce-playground,代碼行數(shù):45,

示例7: disableTemplate

?點(diǎn)讚 2

?

import com.intellij.util.containers.ContainerUtil; //導(dǎo)入方法依賴的package包/類

public void disableTemplate(PostfixTemplate template, String langForProvider) {

Set state = ContainerUtil.getOrCreate(myLangToDisabledTemplates, langForProvider, SET_FACTORY);

state.add(template.getKey());

}

開發(fā)者ID:jskierbi,項(xiàng)目名稱:intellij-ce-playground,代碼行數(shù):5,

注:本文中的com.intellij.util.containers.ContainerUtil.getOrCreate方法示例整理自Github/MSDocs等源碼及文檔管理平臺(tái),相關(guān)代碼片段篩選自各路編程大神貢獻(xiàn)的開源項(xiàng)目,源碼版權(quán)歸原作者所有,傳播和使用請(qǐng)參考對(duì)應(yīng)項(xiàng)目的License;未經(jīng)允許,請(qǐng)勿轉(zhuǎn)載。

總結(jié)

以上是生活随笔為你收集整理的java版本的getorcreate_Java ContainerUtil.getOrCreate方法代碼示例的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。