public void setExtendedInterfaces(List<ObjectType> extendedInterfaces) throws UnsupportedOperationException { if (isInterface()) { this.extendedInterfaces = ImmutableList.copyOf(extendedInterfaces); for (ObjectType extendedInterface : this.extendedInterfaces) { typeOfThis.extendTemplateTypeMap(extendedInterface.getTemplateTypeMap()); } } else { throw new UnsupportedOperationException(); } }
TemplatizedType( JSTypeRegistry registry, ObjectType objectType, ImmutableList<JSType> templateTypes, ImmutableList<JSType> unresolvedTemplateTypes) { super(registry, objectType, objectType.getTemplateTypeMap().addValues(templateTypes)); // Cache which template keys were filled, and what JSTypes they were filled // with. ImmutableList<TemplateType> filledTemplateKeys = objectType.getTemplateTypeMap().getUnfilledTemplateKeys(); ImmutableList.Builder<JSType> builder = ImmutableList.builder(); for (TemplateType filledTemplateKey : filledTemplateKeys) { builder.add(getTemplateTypeMap().getResolvedTemplateType(filledTemplateKey)); } this.templateTypes = builder.build(); this.unresolvedTemplateTypes = unresolvedTemplateTypes; replacer = new TemplateTypeMapReplacer(registry, getTemplateTypeMap()); }
public void setImplementedInterfaces(List<ObjectType> implementedInterfaces) { if (isConstructor()) { // Records this type for each implemented interface. for (ObjectType type : implementedInterfaces) { registry.registerTypeImplementingInterface(this, type); typeOfThis.extendTemplateTypeMap(type.getTemplateTypeMap()); } this.implementedInterfaces = ImmutableList.copyOf(implementedInterfaces); } else { throw new UnsupportedOperationException(); } }
/** * Extends the TemplateTypeMap of the function's this type, based on the specified type. * * @param type */ public void extendTemplateTypeMapBasedOn(ObjectType type) { typeOfThis.extendTemplateTypeMap(type.getTemplateTypeMap()); }