Package com.miniproject.two
Class AuthorData
java.lang.Object
com.miniproject.two.AuthorData
- All Implemented Interfaces:
DataInterface
This class represents the author data.
It contains the author's name and nationality.
-
Constructor Summary
ConstructorDescriptionAuthorData
(String author, String nationality) Constructs an AuthorData object with the given author and nationality. -
Method Summary
Modifier and TypeMethodDescriptionReturns the author's name.Returns the author's nationality.void
Prints the data of the implementing class.void
Prints the footer for the data structure.void
Prints the header for the data structure.void
printRow()
Prints a row of data.void
Sets the author of the author data.void
setNationality
(String nationality) Sets the nationality of the object.
-
Constructor Details
-
AuthorData
Constructs an AuthorData object with the given author and nationality.- Parameters:
author
- the author's namenationality
- the author's nationality
-
-
Method Details
-
getAuthor
Returns the author's name.- Returns:
- the author's name
-
getNationality
Returns the author's nationality.- Returns:
- the author's nationality
-
setAuthor
Sets the author of the author data.- Parameters:
author
- the author's name
-
setNationality
Sets the nationality of the object.- Parameters:
nationality
- the new nationality to set
-
printData
public void printData()Prints the data of the implementing class. This method is meant to output the data in a specific format such as a table. The exact format and contents depend on the implementing class.- Specified by:
printData
in interfaceDataInterface
-
printHeader
public void printHeader()Prints the header for the data structure. This method is intended to print the header section, which usually consists of column names or other relevant headings. The format of the header is determined by the implementing class.- Specified by:
printHeader
in interfaceDataInterface
-
printRow
public void printRow()Prints a row of data. This method is responsible for printing a single row of data. The contents and formatting of the row depend on the implementing class.- Specified by:
printRow
in interfaceDataInterface
-