/** * Returns an interned instance of this class for the given type. * * @param type {@code non-null;} the underlying type * @return {@code non-null;} an appropriately-constructed instance */ public static CstType intern(Type type) { CstType cst = new CstType(type); CstType result = interns.putIfAbsent(type, cst); return result != null ? result : cst; }
/** * Returns an interned instance of this class for the given type. * * @param type {@code non-null;} the underlying type * @return {@code non-null;} an appropriately-constructed instance */ public static CstType intern(Type type) { CstType cst = new CstType(type); CstType result = interns.putIfAbsent(type, cst); return result != null ? result : cst; }
/** * Returns an interned instance of this class for the given type. * * @param type {@code non-null;} the underlying type * @return {@code non-null;} an appropriately-constructed instance */ public static CstType intern(Type type) { CstType cst = new CstType(type); CstType result = interns.putIfAbsent(type, cst); return result != null ? result : cst; }
/** * Returns an interned instance of this class for the given type. * * @param type {@code non-null;} the underlying type * @return {@code non-null;} an appropriately-constructed instance */ public static CstType intern(Type type) { CstType cst = interns.get(type); if (cst == null) { cst = new CstType(type); interns.put(type, cst); } return cst; }
/** * Returns an interned instance of this class for the given type. * * @param type {@code non-null;} the underlying type * @return {@code non-null;} an appropriately-constructed instance */ public static CstType intern(Type type) { synchronized (interns) { CstType cst = interns.get(type); if (cst == null) { cst = new CstType(type); interns.put(type, cst); } return cst; } }
/** * Returns an interned instance of this class for the given type. * * @param type {@code non-null;} the underlying type * @return {@code non-null;} an appropriately-constructed instance */ public static CstType intern(Type type) { synchronized (interns) { CstType cst = interns.get(type); if (cst == null) { cst = new CstType(type); interns.put(type, cst); } return cst; } }
/** * Returns an interned instance of this class for the given type. * * @param type {@code non-null;} the underlying type * @return {@code non-null;} an appropriately-constructed instance */ public static CstType intern(Type type) { synchronized (interns) { CstType cst = interns.get(type); if (cst == null) { cst = new CstType(type); interns.put(type, cst); } return cst; } }
/** * Constructs an instance. * * @param nat {@code non-null;} the name-and-type; the defining class is derived * from this */ public CstEnumRef(CstNat nat) { super(new CstType(nat.getFieldType()), nat); fieldRef = null; }
/** * Constructs an instance. * * @param nat {@code non-null;} the name-and-type; the defining class is derived * from this */ public CstEnumRef(CstNat nat) { super(new CstType(nat.getFieldType()), nat); fieldRef = null; }
/** * Constructs an instance. * * @param nat {@code non-null;} the name-and-type; the defining class is derived * from this */ public CstEnumRef(CstNat nat) { super(new CstType(nat.getFieldType()), nat); fieldRef = null; }
/** * Constructs an instance. * * @param nat {@code non-null;} the name-and-type; the defining class is derived * from this */ public CstEnumRef(CstNat nat) { super(new CstType(nat.getFieldType()), nat); fieldRef = null; }
/** * Constructs an instance. * * @param nat {@code non-null;} the name-and-type; the defining class is derived * from this */ public CstEnumRef(CstNat nat) { super(new CstType(nat.getFieldType()), nat); fieldRef = null; }
/** * Constructs an instance. * * @param nat {@code non-null;} the name-and-type; the defining class is derived * from this */ public CstEnumRef(CstNat nat) { super(new CstType(nat.getFieldType()), nat); fieldRef = null; }
/** * Constructs an instance. * * @param nat {@code non-null;} the name-and-type; the defining class is derived * from this */ public CstEnumRef(CstNat nat) { super(new CstType(nat.getFieldType()), nat); fieldRef = null; }
/** * Constructs an instance. * * @param nat {@code non-null;} the name-and-type; the defining class is derived * from this */ public CstEnumRef(CstNat nat) { super(new CstType(nat.getFieldType()), nat); fieldRef = null; }
/** * Interns an element into this instance. * * @param type {@code non-null;} the type to intern * @return {@code non-null;} the interned reference */ public synchronized TypeIdItem intern(Type type) { if (type == null) { throw new NullPointerException("type == null"); } throwIfPrepared(); TypeIdItem result = typeIds.get(type); if (result == null) { result = new TypeIdItem(new CstType(type)); typeIds.put(type, result); } return result; }
/** * Gets the class definition with the given name, if any. * * @param name {@code non-null;} the class name to look for * @return {@code null-ok;} the class with the given name, or {@code null} * if there is no such class */ public ClassDefItem getClassOrNull(String name) { try { Type type = Type.internClassName(name); return (ClassDefItem) classDefs.get(new CstType(type)); } catch (IllegalArgumentException ex) { // Translate exception, per contract. return null; } }
/** * Gets the class definition with the given name, if any. * * @param name {@code non-null;} the class name to look for * @return {@code null-ok;} the class with the given name, or {@code null} * if there is no such class */ public ClassDefItem getClassOrNull(String name) { try { Type type = Type.internClassName(name); return (ClassDefItem) classDefs.get(new CstType(type)); } catch (IllegalArgumentException ex) { // Translate exception, per contract. return null; } }
/** * Gets the class definition with the given name, if any. * * @param name {@code non-null;} the class name to look for * @return {@code null-ok;} the class with the given name, or {@code null} * if there is no such class */ public ClassDefItem getClassOrNull(String name) { try { Type type = Type.internClassName(name); return (ClassDefItem) classDefs.get(new CstType(type)); } catch (IllegalArgumentException ex) { // Translate exception, per contract. return null; } }