I think not.

When you present the first symbol to the Dictionary, dict.size() will be
zero.  That value will be inserted into the table under that symbol.  Each
new symbol will be inserted with the size of the table as it was *before*
that symbol was inserted.

I have added a line to CsvRecordFactoryTest.testDictionaryOrder to
demonstrate and enforce this.  It won't be committed until the current
release goes out.

On Sat, May 28, 2011 at 9:57 PM, XiaoboGu <[email protected]> wrote:
>
>
> Ok, then target values are always more than 0, I refer to this
>
> public class Dictionary {
>  private final Map<String, Integer> dict = Maps.newLinkedHashMap();
>
>  public int intern(String s) {
>    if (!dict.containsKey(s)) {
>      dict.put(s, dict.size());
>    }
>    return dict.get(s);
>   }
>
>
>

Reply via email to