@tripsnek/tmf
Version:
TypeScript Modeling Framework - A TypeScript port of the Eclipse Modeling Framework (EMF)
53 lines • 1.37 kB
JavaScript
import { ENamedElementImpl } from './enamed-element-impl';
export class ETypedElementImpl extends ENamedElementImpl {
static UNBOUNDED_MULTIPLICITY = -1;
static UNSPECIFIED_MULTIPLICITY = 0;
// private ordered = false;
unique = false;
eType;
lowerBound = ETypedElementImpl.UNSPECIFIED_MULTIPLICITY;
upperBound = ETypedElementImpl.UNSPECIFIED_MULTIPLICITY;
constructor(name, eType) {
super(name);
if (eType)
this.eType = eType;
}
getLowerBound() {
return this.lowerBound;
}
setLowerBound(value) {
this.lowerBound = value;
}
getUpperBound() {
return this.upperBound;
}
setUpperBound(value) {
this.upperBound = value;
}
isUnique() {
return this.unique;
}
setUnique(value) {
this.unique = value;
}
getEType() {
return this.eType;
}
setEType(value) {
this.eType = value;
}
isMany() {
return (this.upperBound > 1 ||
this.upperBound === ETypedElementImpl.UNBOUNDED_MULTIPLICITY);
}
// public isOrdered(): boolean {
// return this.ordered;
// }
// public setOrdered(value: boolean): void {
// this.ordered = value;
// }
isRequired() {
return this.lowerBound > 0;
}
}
//# sourceMappingURL=etyped-element-impl.js.map