|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectedu.northwestern.at.wordhoard.swing.calculator.modelutils.AuthorUtils
public class AuthorUtils
Author utilities.
| Constructor Summary | |
|---|---|
protected |
AuthorUtils()
Don't allow instantiation but do allow overrides. |
| Method Summary | |
|---|---|
static Author |
getAuthor(java.lang.String authorName)
Get an author by name. |
static Author[] |
getAuthors()
Get array of all available authors. |
static Author[] |
getContemporaries(Author author,
int yearsBefore,
int yearsAfter)
Get contemporaries of an author. |
static Author[] |
getContemporaries(java.lang.String authorName,
int yearsBefore,
int yearsAfter)
Get contemporaries of an author. |
static Work[] |
getEarliestAndLatestWork(Author author)
Get earliest and latest works for an author. |
static int[] |
getEarliestAndLatestWorkDates(Author author)
Get earliest and latest work dates for an author. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected AuthorUtils()
| Method Detail |
|---|
public static Author[] getContemporaries(Author author,
int yearsBefore,
int yearsAfter)
author - The author for whom to find contemporaries.yearsBefore - Number of years before the author was born
to consider as a lower bound on the
birth date for a contemporary.yearsAfter - Number of years after the author died
to consider as an upper bound on the
death date for a contemporary.
A contemporary is defined as an author who was born up to author's birth date - yearsBefore years before the subject author, and died up to author's death date + yearsAfter after the subject author.
public static Author[] getContemporaries(java.lang.String authorName,
int yearsBefore,
int yearsAfter)
authorName - Name of author for whom to find contemporaries.yearsBefore - Number of years before the author was born
to consider as a lower bound on the
birth date for a contemporary.yearsAfter - Number of years after the author died
to consider as an upper bound on the
death date for a contemporary.
A contemporary is defined as an author who was born up to author's birth date - yearsBefore years before the subject author, and died up to author's death date + yearsAfter after the subject author.
public static Author getAuthor(java.lang.String authorName)
authorName - The author's name.
public static Author[] getAuthors()
public static Work[] getEarliestAndLatestWork(Author author)
author - The author.
Work array as follows.
result[0] = earliest work by author.
result[1] = latest work by author.
If an author exists but has no works, the result is null.
public static int[] getEarliestAndLatestWorkDates(Author author)
author - The author.
If an author exists but has no works, both years are returned as Integer.MIN_VALUE .
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||