本文整理匯總了Java中com.google.common.collect.Interners.newWeakInterner方法的典型用法代碼示例。如果您正苦於以下問題:Java Interners.newWeakInterner方法的具體用法?Java Interners.newWeakInterner怎麽用?Java Interners.newWeakInterner使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.google.common.collect.Interners
的用法示例。
在下文中一共展示了Interners.newWeakInterner方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: makeInterner
import com.google.common.collect.Interners; //導入方法依賴的package包/類
public static Interner<String> makeInterner ( final String specificPropertyName, final String defaultType )
{
final String type = System.getProperty ( specificPropertyName, System.getProperty ( "org.eclipse.scada.defaultStringInterner", defaultType ) );
if ( "weak".equals ( type ) )
{
return new NullSafeInterner ( Interners.<String> newWeakInterner () );
}
else if ( "strong".equals ( type ) )
{
return new NullSafeInterner ( Interners.<String> newStrongInterner () );
}
else if ( "java".equals ( type ) )
{
return new JavaStringInterner ();
}
else
{
return makeNoOpInterner ();
}
}
示例2: findInterner
import com.google.common.collect.Interners; //導入方法依賴的package包/類
private Interner<String> findInterner() {
Player player = gameManager.getPlayerManager().getPlayer(playerId);
Interner<String> interner;
if (player == null) {
interner = Interners.newWeakInterner();
} else {
interner = player.getInterner();
}
return interner;
}
示例3: SimpleFileProviderBackend
import com.google.common.collect.Interners; //導入方法依賴的package包/類
public SimpleFileProviderBackend(Configuration conf, Path resourcePath) throws IOException {
this.resourcePath = resourcePath;
this.fileSystem = resourcePath.getFileSystem(conf);
this.groupRolePrivilegeTable = HashBasedTable.create();
this.conf = conf;
this.configErrors = Lists.newArrayList();
this.configWarnings = Lists.newArrayList();
this.validators = ImmutableList.of();
this.allowPerDatabaseSection = true;
this.initialized = false;
this.stringInterner = Interners.newWeakInterner();
}
示例4: StringInterner
import com.google.common.collect.Interners; //導入方法依賴的package包/類
public StringInterner() {
this.interner = Interners.newWeakInterner();
}
示例5: XFactoryEfficientImpl
import com.google.common.collect.Interners; //導入方法依賴的package包/類
public XFactoryEfficientImpl() {
super();
// Use an weak references as this factory may stay around in the XFactoryRegistry for a long time
interner = Interners.newWeakInterner();
}
示例6: XFactoryMemoryImpl
import com.google.common.collect.Interners; //導入方法依賴的package包/類
public XFactoryMemoryImpl() {
super();
// Use an weak references as this factory may stay around in the XFactoryRegistry for a long time
interner = Interners.newWeakInterner();
}
示例7: XFactoryNaiveImpl
import com.google.common.collect.Interners; //導入方法依賴的package包/類
public XFactoryNaiveImpl() {
super();
// Use an weak references as this factory may stay around in the XFactoryRegistry for a long time
interner = Interners.newWeakInterner();
}
示例8: WeakMapStringPool
import com.google.common.collect.Interners; //導入方法依賴的package包/類
public WeakMapStringPool(StringPoolPolicy heuristic) {
super(heuristic);
this.interner = Interners.newWeakInterner();
}