ubiware.util
Class WhiteSpaceString
java.lang.Object
ubiware.util.WhiteSpaceString
public class WhiteSpaceString
- extends java.lang.Object
This class is used for optimizing the usage of long strings of whitespaces. It has one long string from which substrings are taken. This
allows the JVM to reuse that memory. When a whitespace string longer than the cached string is requested, a new (longer) string will be
generated and kept for later use.
15.3.2010
- Author:
- Michael Cochez for UBIWARE project
Method Summary |
static java.lang.String |
getWhiteSpaceString(int length)
generates a String of whitespaces with the given length |
static void |
main(java.lang.String[] args)
runs a small test for the optimizer |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
WhiteSpaceString
public WhiteSpaceString()
getWhiteSpaceString
public static java.lang.String getWhiteSpaceString(int length)
- generates a
String
of whitespaces with the given length
- Parameters:
length
-
- Returns:
- The string of whitespaces with the requested length.
main
public static void main(java.lang.String[] args)
- runs a small test for the optimizer
- Parameters:
args
-