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


Java Interner.intern方法代碼示例

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


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

示例1: ScriptMonitor

import com.google.common.collect.Interner; //導入方法依賴的package包/類
public ScriptMonitor ( final String id, final String factoryId, final Executor executor, final BundleContext context, final Interner<String> stringInterner, final EventProcessor eventProcessor, final ObjectPoolTracker<DataSource> dataSourcePoolTracker, final ObjectPoolTracker<MasterItem> masterItemPoolTracker, final ServiceTracker<ConfigurationAdministrator, ConfigurationAdministrator> caTracker )
{
    super ( id, factoryId, executor, context, stringInterner, eventProcessor );
    this.executor = executor;

    this.prefix = stringInterner.intern ( factoryId + ". " + id ); //$NON-NLS-1$

    this.classLoader = getClass ().getClassLoader ();

    this.monitorStateInjector = new MonitorStateInjector ( stringInterner );
    this.monitorStateInjector.setPrefix ( this.prefix );

    this.handler = new InjectMasterHandler ( id, masterItemPoolTracker, 0, caTracker, this.prefix, factoryId );
    this.listener = new MultiDataSourceListener ( dataSourcePoolTracker ) {

        @Override
        protected void handleChange ( final Map<String, DataSourceHandler> sources )
        {
            ScriptMonitor.this.handleChange ( sources );
        }
    };
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:23,代碼來源:ScriptMonitor.java

示例2: getPrefixed

import com.google.common.collect.Interner; //導入方法依賴的package包/類
protected String getPrefixed ( final String id, final Interner<String> stringInterner )
{
    if ( id == null )
    {
        return this.prefix;
    }
    else
    {
        return stringInterner.intern ( this.dotPrefix + id );
    }
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:12,代碼來源:AbstractConfigurableMasterHandlerImpl.java

示例3: splitFileName

import com.google.common.collect.Interner; //導入方法依賴的package包/類
/**
 * Split the file into a filename/directory pair.
 *
 * @param interner The interner to use for interning the strings.
 * @param input The input to split.
 * @return The pair of directory, filename.
 */
private FileName splitFileName(
    Interner<String> interner, String input) {
  int hashIndex = input.lastIndexOf('/');
  String dir = interner.intern(input.substring(0, hashIndex + 1));
  String fileName = interner.intern(input.substring(hashIndex + 1));
  return new FileName(dir, fileName);
}
 
開發者ID:SpoonLabs,項目名稱:astor,代碼行數:15,代碼來源:SourceMapConsumerV1.java

示例4: setMarkForDelete

import com.google.common.collect.Interner; //導入方法依賴的package包/類
@Override
public void setMarkForDelete(boolean isMark) {
    Interner<String> interner = findInterner();
    synchronized (interner.intern(playerId)) {
        Optional<PlayerMetadata> playerMetadataOptional = gameManager.getPlayerManager().getPlayerMetadata(playerId);
        if (!playerMetadataOptional.isPresent()) {
            return;
        }
        PlayerMetadata playerMetadata = playerMetadataOptional.get();
        playerMetadata.setIsMarkedForDelete(isMark);
        gameManager.getPlayerManager().savePlayerMetadata(playerMetadata);
    }
}
 
開發者ID:chriskearney,項目名稱:creeper,代碼行數:14,代碼來源:PlayerManagement.java


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