Code example for Interner

Methods: intern

0
    /** Keep track of tags that have been seen before and reuse. */ 
    private static final Interner<Tag> TAG_CACHE = Interners.newWeakInterner();
 
    /** Intern strings used for tag keys or values. */ 
    public static String intern(String v) {
        return STR_CACHE.intern(v);
    } 
 
    /** Returns the canonical representation of a tag. */ 
    public static Tag intern(Tag t) {
        return TAG_CACHE.intern(t);
    } 
 
    /** 
     * Interns custom tag types, assumes that basic tags are already interned. This is used to 
     * ensure that we have a common view of tags internally. In particular, different subclasses of 
     * Tag may not be equal even if they have the same key and value. Tag lists should use this to 
     * ensure the equality will work as expected. 
     */ 
    static Tag internCustom(Tag t) {