1b: add AuthoredItem as superclass for Article and Image
This commit is contained in:
parent
db12a40520
commit
67e5565b54
@ -23,11 +23,4 @@ public class Article extends AuthoredItem {
|
|||||||
return "Article: " + getTitle() + ", Author: "
|
return "Article: " + getTitle() + ", Author: "
|
||||||
+ getAuthor();
|
+ getAuthor();
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getDetails(){
|
|
||||||
return "###" + getTitle() + "###"
|
|
||||||
+ "\n"
|
|
||||||
+ getContent()
|
|
||||||
+ "\n\n";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,15 @@ public abstract class AuthoredItem extends Item{
|
|||||||
protected String author;
|
protected String author;
|
||||||
protected String content;
|
protected String content;
|
||||||
|
|
||||||
|
public String getDetails(){
|
||||||
|
return "###" + getTitle() + "###"
|
||||||
|
+ "\n"
|
||||||
|
+ getContent()
|
||||||
|
+ "\n\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
//=================================
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the title of the AuthoredItem.
|
* Get the title of the AuthoredItem.
|
||||||
*
|
*
|
||||||
|
@ -32,13 +32,6 @@ public class Image extends AuthoredItem {
|
|||||||
+ ", Author: " + getAuthor();
|
+ ", Author: " + getAuthor();
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getDetails(){
|
|
||||||
return "###" + getTitle() + "###"
|
|
||||||
+ "\n"
|
|
||||||
+ getContent()
|
|
||||||
+ "\n\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
//=================================
|
//=================================
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user