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