Interface ObjSet<E>

    • Method Detail

      • getInternal

        @Nullable E getInternal​(E e)
        Returns the object held by this set internally and equivalent to the given object e, if there is one, or null if this set contains no such element (optional operation).

        This method could be used to deduplicate objects in the application, to reduce the memory footprint and make the application to conform to the "most objects die young" hypothesis that most GC algorithms are optimized for. This method is functionally similar to String.intern() and Guava's Interner, but allows to piggy-back a map data structure which may already exist in the application.

        Parameters:
        e - the object whose equivalent held by this set internally is to be returned
        Returns:
        the set-internal equivalent of the specified object, or null if the set contains no such element
        Throws:
        UnsupportedOperationException - if this set doesn't support returning an internal copy of an element, e. g. because it's a "virtual" view of another collection