public class Fiction extends Book implements Comparable
Modifier and Type | Field and Description |
---|---|
protected String |
mainCharacter
The main character's name, or "none" if the main
character has not been set.
|
Constructor and Description |
---|
Fiction()
Creates a Fiction with default values.
|
Fiction(String theAuthor,
String theTitle,
int thePages,
Double theValue,
String theMainCharacter)
Creates a Fiction.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Object obj) |
String |
getMainCharacter()
Gets the main character.
|
void |
setMainCharacter(String theMainCharacter)
Sets the main character.
|
String |
toString() |
protected String mainCharacter
public Fiction()
public Fiction(String theAuthor, String theTitle, int thePages, Double theValue, String theMainCharacter)
theAuthor
- the author.theTitle
- the title.thePages
- the number of pages.theValue
- the value in arbitrary units.theMainCharacter
- the main character's name.public void setMainCharacter(String theMainCharacter)
theMainCharacter
- the main character's name.public String getMainCharacter()
public int compareTo(Object obj)
compareTo
in interface Comparable