com.google.clearsilver.jsilver.data
Class NativeStringInternStrategy
java.lang.Object
com.google.clearsilver.jsilver.data.NativeStringInternStrategy
- All Implemented Interfaces:
- StringInternStrategy
public class NativeStringInternStrategy
- extends Object
- implements StringInternStrategy
Implementation of StringInternStrategy
using Java String Pool and String.intern()
method.
Method Summary |
String |
intern(String value)
Interns a String object in a pool and returns a String equal to the one provided. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NativeStringInternStrategy
public NativeStringInternStrategy()
intern
public String intern(String value)
- Description copied from interface:
StringInternStrategy
- 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.
- Specified by:
intern
in interface StringInternStrategy
- Parameters:
value
- String to be interned
- Returns:
- a String that is equal to the one provided.
Copyright © 2010-2012 Google. All Rights Reserved.