net.sf.beanform.util
Class StringCache

java.lang.Object
  extended by net.sf.beanform.util.StringCache

public class StringCache
extends Object

A thread-safe cache of strings that allows aliasing of long strings to smaller strings that can then be used to reverse the process.

Author:
Daniel Gredler

Field Summary
protected  Map<String,String> cacheByReal
           
protected  Map<String,String> cacheByShort
           
protected static char[] CHARS
           
protected  int maxSize
           
 
Constructor Summary
StringCache(int maxSize)
           
 
Method Summary
protected static String getChars(char[] chars, int index)
           
 String getRealVersion(String shortVersion)
           
 String getShortVersion(String real)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CHARS

protected static final char[] CHARS

maxSize

protected int maxSize

cacheByShort

protected Map<String,String> cacheByShort

cacheByReal

protected Map<String,String> cacheByReal
Constructor Detail

StringCache

public StringCache(int maxSize)
Method Detail

getShortVersion

public String getShortVersion(String real)

getRealVersion

public String getRealVersion(String shortVersion)

getChars

protected static String getChars(char[] chars,
                                 int index)


Copyright © 2005-2008 SourceForge.net. All Rights Reserved.