Class CharDeduplication

java.lang.Object
org.aspectj.org.eclipse.jdt.internal.compiler.util.CharDeduplication

public class CharDeduplication extends Object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    number of entries to linear search affects performance but decreases collisions - does not affect memory
    static final int
    size of hash table, does not affect performance due to hashing but affects memory
  • Method Summary

    Modifier and Type
    Method
    Description
     
    void
    Deprecated.
    char[]
    sharedCopyOfRange(char[] source, int from, int to)
    like Arrays.copyOfRange(source, from, to) but returns a cached instance of the former result if available

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • TABLE_SIZE

      public static final int TABLE_SIZE
      size of hash table, does not affect performance due to hashing but affects memory
      See Also:
    • SEARCH_SIZE

      public static final int SEARCH_SIZE
      number of entries to linear search affects performance but decreases collisions - does not affect memory
      See Also:
  • Method Details

    • getThreadLocalInstance

      public static CharDeduplication getThreadLocalInstance()
      Returns:
      an instance that is *not* thread safe. To be used in a single thread only.
    • reset

      @Deprecated public void reset()
      Deprecated.
      public for test purpose only
    • sharedCopyOfRange

      public char[] sharedCopyOfRange(char[] source, int from, int to)
      like Arrays.copyOfRange(source, from, to) but returns a cached instance of the former result if available
      Parameters:
      from - start index (inclusive)
      to - end index (exclusive)
      Returns:
      source[from..to-1]
      See Also: