|
@@ -14,7 +14,7 @@ class ReferenceItem {
|
|
|
static department = 'Research';
|
|
|
private _publisher: string;
|
|
|
|
|
|
- constructor(public title: string, private year: number) {
|
|
|
+ constructor(public title: string, protected year: number) {
|
|
|
}
|
|
|
|
|
|
printItem(): void {
|
|
@@ -31,4 +31,24 @@ class ReferenceItem {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-export { ReferenceItem, UniversityLibrarian };
|
|
|
+class Encyclopedia extends ReferenceItem {
|
|
|
+ constructor(newTitle: string, newYear: number, public edition: number) {
|
|
|
+ super(newTitle, newYear);
|
|
|
+ }
|
|
|
+
|
|
|
+ printItem(): void {
|
|
|
+ super.printItem();
|
|
|
+ console.log(`Edition: ${this.edition} (${this.year}).`);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+class Journal extends ReferenceItem {
|
|
|
+ public contributors: string[];
|
|
|
+
|
|
|
+ constructor(title: string, year: number) {
|
|
|
+ super(title, year);
|
|
|
+ }
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+export { Encyclopedia, ReferenceItem, UniversityLibrarian };
|