"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
class Language {
    constructor() {
        this.concepts = new Map();
        this.interfaces = new Map();
    }
    static getInstance() {
        if (Language.theInstance === null) {
            Language.theInstance = new Language();
        }
        return Language.theInstance;
    }
    concept(typeName) {
        return this.concepts.get(typeName);
    }
    interface(typeName) {
        return this.interfaces.get(typeName);
    }
    conceptProperty(typeName, propertyName) {
        return this.concepts.get(typeName).properties.get(propertyName);
    }
    interfaceProperty(typeName, propertyName) {
        return this.interfaces.get(typeName).properties.get(propertyName);
    }
    allConceptProperties(typeName) {
        var _a;
        return (_a = this.concepts.get(typeName)) === null || _a === void 0 ? void 0 : _a.properties.values();
    }
    createConcept(typeName) {
        return this.concepts.get(typeName).constructor();
    }
    addConcept(concept) {
        this.concepts.set(concept.typeName, concept);
    }
    addInterface(intface) {
        this.interfaces.set(intface.typeName, intface);
    }
    subConcepts(typeName) {
        const concept = this.concept(typeName);
        if (!!concept) {
            return concept.subConceptNames;
        }
        const intface = this.interface(typeName);
        if (!!intface) {
            return intface.subConceptNames;
        }
        return [];
    }
    addReferenceCreator(creator) {
        this.referenceCreator = creator;
    }
}
exports.Language = Language;
Language.theInstance = null;
//# sourceMappingURL=Language.js.map