com.google.clearsilver.jsilver.data
Interface StringInternStrategy

All Known Implementing Classes:
NativeStringInternStrategy, NoOpStringInternStrategy

public interface StringInternStrategy

Encapsulates the WeakInterningPool<String> functionality with added optimizations. To be used to optimize the memory usage and garbage collection during text processing.


Method Summary
 String intern(String value)
          Interns a String object in a pool and returns a String equal to the one provided.
 

Method Detail

intern

String intern(String value)
Interns a String object in a pool and returns a String equal to the one provided.

If there exists a String in the pool equal to the provided value then it will be returned. Otherwise provided String may be interned.

There is no guarantees on when the pool will return the same object as provided. It is possible that value == intern(value) will never be true.

Parameters:
value - String to be interned
Returns:
a String that is equal to the one provided.


Copyright © 2010-2012 Google. All Rights Reserved.