Refine search
public String addName(String name, int q1) { _verifySharing(); if (_intern) { name = InternCache.instance.intern(name); } int offset = _findOffsetForAdd(calcHash(q1)); _hashArea[offset] = q1; _hashArea[offset+3] = 1; _names[offset >> 2] = name; ++_count; _verifyNeedForRehash(); return name; }
public String intern(String input) { String result = get(input); if (result != null) { return result; } /* 18-Sep-2013, tatu: We used to use LinkedHashMap, which has simple LRU * method. No such functionality exists with CHM; and let's use simplest * possible limitation: just clear all contents. This because otherwise * we are simply likely to keep on clearing same, commonly used entries. */ if (size() >= MAX_ENTRIES) { /* Not incorrect wrt well-known double-locking anti-pattern because underlying * storage gives close enough answer to real one here; and we are * more concerned with flooding than starvation. */ synchronized (lock) { if (size() >= MAX_ENTRIES) { clear(); } } } result = input.intern(); put(result, result); return result; } }
/** * @since 2.6 */ public static PropertyName construct(String simpleName) { if (simpleName == null || simpleName.length() == 0) { return USE_DEFAULT; } return new PropertyName(InternCache.instance.intern(simpleName), null); }
protected static String _fromName(Named n, boolean alreadyInterned) { if (n == null) return null; String name = n.getName(); return alreadyInterned ? name : INTERNER.intern(name); }
@Override protected boolean removeEldestEntry(Map.Entry<String,String> eldest) { return size() > MAX_ENTRIES; }
public static PropertyName construct(String simpleName, String ns) { if (simpleName == null) { simpleName = ""; } if (ns == null && simpleName.length() == 0) { return USE_DEFAULT; } return new PropertyName(InternCache.instance.intern(simpleName), ns); }
newSymbol = InternCache.instance.intern(newSymbol);
@Override protected boolean removeEldestEntry(Map.Entry<String,String> eldest) { return size() > MAX_ENTRIES; }
public String addName(String name, int q1, int q2, int q3) { _verifySharing(); if (_intern) { name = InternCache.instance.intern(name); } int offset = _findOffsetForAdd(calcHash(q1, q2, q3)); _hashArea[offset] = q1; _hashArea[offset+1] = q2; _hashArea[offset+2] = q3; _hashArea[offset+3] = 3; _names[offset >> 2] = name; ++_count; _verifyNeedForRehash(); return name; }
public PropertyName internSimpleName() { if (_simpleName.length() == 0) { // empty String is canonical already return this; } String interned = InternCache.instance.intern(_simpleName); if (interned == _simpleName) { // was already interned return this; } return new PropertyName(interned, _namespace); }
public String intern(String input) { String result = get(input); if (result != null) { return result; } /* 18-Sep-2013, tatu: We used to use LinkedHashMap, which has simple LRU * method. No such functionality exists with CHM; and let's use simplest * possible limitation: just clear all contents. This because otherwise * we are simply likely to keep on clearing same, commonly used entries. */ if (size() >= MAX_ENTRIES) { /* Not incorrect wrt well-known double-locking anti-pattern because underlying * storage gives close enough answer to real one here; and we are * more concerned with flooding than starvation. */ synchronized (lock) { if (size() >= MAX_ENTRIES) { clear(); } } } result = input.intern(); put(result, result); return result; } }
newSymbol = InternCache.instance.intern(newSymbol);
public String addName(String name, int q1, int q2) { _verifySharing(); if (_intern) { name = InternCache.instance.intern(name); } int hash = (q2 == 0) ? calcHash(q1) : calcHash(q1, q2); int offset = _findOffsetForAdd(hash); _hashArea[offset] = q1; _hashArea[offset+1] = q2; _hashArea[offset+3] = 2; _names[offset >> 2] = name; ++_count; _verifyNeedForRehash(); return name; }
public static PropertyName construct(String simpleName, String ns) { if (simpleName == null) { simpleName = ""; } if (ns == null && simpleName.length() == 0) { return USE_DEFAULT; } return new PropertyName(InternCache.instance.intern(simpleName), ns); }
public String intern(String input) { String result = get(input); if (result != null) { return result; } /* 18-Sep-2013, tatu: We used to use LinkedHashMap, which has simple LRU * method. No such functionality exists with CHM; and let's use simplest * possible limitation: just clear all contents. This because otherwise * we are simply likely to keep on clearing same, commonly used entries. */ if (size() >= MAX_ENTRIES) { /* Not incorrect wrt well-known double-locking anti-pattern because underlying * storage gives close enough answer to real one here; and we are * more concerned with flooding than starvation. */ synchronized (lock) { if (size() >= MAX_ENTRIES) { clear(); } } } result = input.intern(); put(result, result); return result; } }
protected AvroFieldReader(String name, boolean isSkipper, String typeId) { name = INTERNER.intern(name); _name = name; _isSkipper = isSkipper; _typeId = typeId; }
public String addName(String name, int q1) { _verifySharing(); if (_intern) { name = InternCache.instance.intern(name); } int offset = _findOffsetForAdd(calcHash(q1)); _hashArea[offset] = q1; _hashArea[offset+3] = 1; _names[offset >> 2] = name; ++_count; _verifyNeedForRehash(); return name; }
public static PropertyName construct(String simpleName, String ns) { if (simpleName == null) { simpleName = ""; } if (ns == null && simpleName.length() == 0) { return USE_DEFAULT; } return new PropertyName(InternCache.instance.intern(simpleName), ns); }