org.hippoecm.hst.configuration
Class StringPool

java.lang.Object
  extended by org.hippoecm.hst.configuration.StringPool

public class StringPool
extends Object

A String pool utility that can be used to return an already present String object from the heap instead of creating new Strings for String objects that are equal. Since the hst configuration object contains many equal strings for multiple sites, this saves lots of memory.


Method Summary
static void clear()
          Clears the entire StringPool
static String get(String string)
          If string is already present in the pool (same hashcode and equals), then the already present String object is returned.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

get

public static String get(String string)
If string is already present in the pool (same hashcode and equals), then the already present String object is returned. Else, the string is added to the stringPool.

Parameters:
string -
Returns:
the String object from the argument or if their was already and equal object in the pool, the object that was already there.

clear

public static void clear()
Clears the entire StringPool



Copyright © 2008-2012 Hippo. All Rights Reserved.