org.apache.lucene.util
Class SimpleStringInterner

java.lang.Object
  extended by org.apache.lucene.util.StringInterner
      extended by org.apache.lucene.util.SimpleStringInterner

public class SimpleStringInterner
extends StringInterner

Simple lockless and memory barrier free String intern cache that is guaranteed to return the same String instance as String.intern() does.

NOTE: This API is for internal purposes only and might change in incompatible ways in the next release.

Constructor Summary
SimpleStringInterner(int tableSize, int maxChainLength)
           
 
Method Summary
 String intern(String s)
          Returns a single object instance for each equal string.
 
Methods inherited from class org.apache.lucene.util.StringInterner
intern
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleStringInterner

public SimpleStringInterner(int tableSize,
                            int maxChainLength)
Parameters:
tableSize - Size of the hash table, should be a power of two.
maxChainLength - Maximum length of each bucket, after which the oldest item inserted is dropped.
Method Detail

intern

public String intern(String s)
Description copied from class: StringInterner
Returns a single object instance for each equal string.

Overrides:
intern in class StringInterner


Copyright © 2000-2011 Apache Software Foundation. All Rights Reserved.