author or editor field in bibtex record.
Constructor performs parsing of raw field text and stores preformatted data. Various accessor methods return author/editor field in different formats.
Parsing algorithm is designed to satisfy two requirements: (a) when author's name is typed correctly, the result should coincide with the one of BiBTeX; (b) for erroneous names, output should be reasonable (but may differ from BiBTeX output). The following rules are used:
Character.isWhitespace(c)==true),
commas (,), dashes (-), and tildas (~);
"a - b" consists of
2 tokens ("a" and "b"), while "a,-,b" consists of 3 tokens
("a", "", and "b")
"abc x{a,b,-~ c}x" consists of 2 tokens, while "abc xa,b,-~ cx"
consists of 4 tokens ("abc", "xa", "b", and "cx");
"a-b- c - d" tokens "a" and "b" are dash-terminated and "c"
and "d" are space-terminated;
Character.isLetter(c)==true)
that does not belong to a sequence of letters that immediately follows
the \ character, with one exception: if \ is followed by aa,
AA, ae, AE, l, L, o, O, oe, OE, i, or j
followed by non-letter, the 'first letter' of a token is a letter
that follows \; for example: in "a{x}b" 'first letter' is "a",
in "{\"{U}}bel" 'first letter' is "U", in "{\noopsort{\"o}}xyz"
'first letter' is "o", in "{\AE}x" 'first letter' is "A", in
"\aex\ijk\Oe\j" 'first letter' is "j"; if there is no letter
satisfying the above rule, 'first letter' is undefined;
Character.isLowerCase(c)==true), and token is
"upper-case" token otherwise;
"a", "{\"{U}}", "{\noopsort{\"o}}",
"{\AE}", "\aex\ijk\Oe\j";
"{\noopsort{A}}john", we
abbreviate it as "{\noopsort{A}}.", while BiBTeX produces "j.";
fixing this problem, however, requires processing of the preabmle;
and (and is case-insensitive); if 'author name' is an empty
sequence of tokens, it is ignored; for examle, both
"John Smith and Peter Black" and
"and and John Smith and and Peter Black" consists of 2 'author name's
"Johm Smith" and "Peter Black" (in erroneous situations, this is a bit
different from BiBTeX behavior);
"John James Smith", 'last-part'="Smith" and
'first-part'="John James";
"von der", 'first-part'='last-part'="",
'von-part'="von der"; in
"Charles Louis Xavier Joseph de la Vall{\'e}e la Poussin",
'first-part'="Charles Louis Xavier Joseph", 'von-part'="de la",
'last-part'="Vall{\'e}e la Poussin";
"de la Vall{\'e}e la Poussin, Charles Louis Xavier Joseph",
'first-part'="Charles Louis Xavier Joseph", 'von-part'="de la",
'last-part'="Vall{\'e}e la Poussin"; in
"Joseph de la Vall{\'e}e la Poussin, Charles Louis Xavier",
'first-part'="Charles Louis Xavier", 'von-part'="",
'last-part'="Joseph de la Vall{\'e}e la Poussin";
"de la Vall{\'e}e Poussin, Jr., Charles Louis Xavier Joseph",
'first-part'="Charles Louis Xavier Joseph", 'von-part'="de la",
'last-part'="Vall{\'e}e la Poussin", and 'junior-part'="Jr.";
"Heinrich-{\"{U}}bel Kurt von Minich",
'first-part'="Heinrich-{\"{U}}bel Kurt", and its abbreviation is
"H.-{\"{U}}. K."
| Modifier and Type | Field and Description |
|---|---|
| private static final Cache | |
| private static final int | |
| private final List | |
| private @Nullable AuthorList |
| Access | Constructor and Description |
|---|---|
| private | AuthorList(@NonNull List<Author>
the list of authors which should underlie this instance authors)Creates a new list of authors. |
| Modifier and Type | Method and Description |
|---|---|
| private static String | |
| private static String | |
| public static Collector | |
| public boolean | Returns: true iff the other object is an AuthorList, all contained authors are in the same order (and these authors' fields are Objects.equals)Overrides java. Compare this object with the given one. |
| public static String | |
| public static String | fixAuthorFirstNameFirstCommas(String authors, boolean abbreviate, boolean oxfordComma)
This is a convenience method for getAuthorsFirstFirst() |
| public static String | fixAuthorForAlphabetization(String authors)
This is a convenience method for getAuthorsForAlphabetization() |
| public static String | fixAuthorLastNameFirst(String authors)
This is a convenience method for getAuthorsLastFirstAnds(true) |
| public static String | fixAuthorLastNameFirst(String authors, boolean abbreviate)
This is a convenience method for getAuthorsLastFirstAnds() |
| public static String | fixAuthorLastNameFirstCommas(String authors, boolean abbreviate, boolean oxfordComma)
This is a convenience method for getAuthorsLastFirst() |
| public static String | fixAuthorLastNameOnlyCommas(String authors, boolean oxfordComma)
This is a convenience method for getAuthorsLastOnly() |
| public static String | |
| public String | Returns: formatted list of authors.whether to abbreivate first names. abbreviate, boolean Whether to put a comma before the and at the end. oxfordComma)Returns the list of authors separated by commas with first names before last name; first names are abbreviated or not depending on parameter. |
| public String | Returns: formatted list of authors.Returns the list of authors separated by "and"s with first names before last name; first names are not abbreviated. |
| public String | getAsLastFirstFirstLastNamesWithAnd(boolean
first names. abbreviate)Returns a list of authors separated with "and". |
| public String | Returns: formatted list of authors.whether to abbreivate first names. abbreviate, boolean Whether to put a comma before the and at the end. oxfordComma)Returns the list of authors separated by commas with first names after last name; first names are abbreviated or not depending on parameter. |
| public String | Returns: formatted list of authors.Returns the list of authors separated by "and"s with first names after last name; first names are not abbreviated. |
| public String | Returns: formatted list of authors.Whether to put a comma before the and at the end. oxfordComma)Returns the list of authors separated by commas with last name only; If the list consists of two or more authors, "and" is inserted before the last author's name. |
| public String | |
| public Author | Returns: theAuthor object.Index of the author (from 0 to i)size()-1).Returns the |
| public List | |
| public String | Returns: formatted list of authorsReturns the list of authors in a form suitable for alphabetization. |
| public int | Returns: the number of author names in this object.Returns the number of author names in this object. |
| public int | |
| public boolean | Returns: true if there are no authors in the list.Returns true if there are no authors in the list. |
| public Iterator | |
| public AuthorList | |
| public static AuthorList | |
| public static AuthorList | |
| public static AuthorList | |
| public String |
| AUTHOR_CACHE | back to summary |
|---|---|
| private static final Cache<String, AuthorList> AUTHOR_CACHE | |
| AUTHOR_CACHE_SIZE | back to summary |
|---|---|
| private static final int AUTHOR_CACHE_SIZE | |
| authors | back to summary |
|---|---|
| private final List<Author> authors | |
| latexFreeAuthors | back to summary |
|---|---|
| private @Nullable AuthorList latexFreeAuthors | |
| AuthorList | back to summary |
|---|---|
| private AuthorList(@NonNull List<Author> authors) Creates a new list of authors. Don't call this constructor directly but rather use the getAuthorList() method which caches its results. | |
| andCoordinatedConjunction | back to summary |
|---|---|
| private static String andCoordinatedConjunction(List<Author> authors, Function<Author, String> style, boolean oxfordComma) | |
| andCoordinatedConjunction | back to summary |
|---|---|
| private static String andCoordinatedConjunction(List<String> authors, boolean oxfordComma) | |
| collect | back to summary |
|---|---|
| public static Collector | |
| equals | back to summary |
|---|---|
| public boolean equals(Object o) Overrides java. Compare this object with the given one.
| |
| fixAuthorFirstNameFirst | back to summary |
|---|---|
| public static String fixAuthorFirstNameFirst(String authors) This is a convenience method for getAuthorsFirstFirstAnds() | |
| fixAuthorFirstNameFirstCommas | back to summary |
|---|---|
| public static String fixAuthorFirstNameFirstCommas(String authors, boolean abbreviate, boolean oxfordComma) This is a convenience method for getAuthorsFirstFirst()
| |
| fixAuthorForAlphabetization | back to summary |
|---|---|
| public static String fixAuthorForAlphabetization(String authors) This is a convenience method for getAuthorsForAlphabetization()
| |
| fixAuthorLastNameFirst | back to summary |
|---|---|
| public static String fixAuthorLastNameFirst(String authors) This is a convenience method for getAuthorsLastFirstAnds(true) | |
| fixAuthorLastNameFirst | back to summary |
|---|---|
| public static String fixAuthorLastNameFirst(String authors, boolean abbreviate) This is a convenience method for getAuthorsLastFirstAnds() | |
| fixAuthorLastNameFirstCommas | back to summary |
|---|---|
| public static String fixAuthorLastNameFirstCommas(String authors, boolean abbreviate, boolean oxfordComma) This is a convenience method for getAuthorsLastFirst()
| |
| fixAuthorLastNameOnlyCommas | back to summary |
|---|---|
| public static String fixAuthorLastNameOnlyCommas(String authors, boolean oxfordComma) This is a convenience method for getAuthorsLastOnly()
| |
| fixAuthorNatbib | back to summary |
|---|---|
| public static String fixAuthorNatbib(String authors) This is a convenience method for getAuthorsNatbib()
| |
| getAsFirstLastNames | back to summary |
|---|---|
| public String getAsFirstLastNames(boolean abbreviate, boolean oxfordComma) Returns the list of authors separated by commas with first names before last name; first names are abbreviated or not depending on parameter. If the list consists of three or more authors, "and" is inserted before the last author's name.
| |
| getAsFirstLastNamesWithAnd | back to summary |
|---|---|
| public String getAsFirstLastNamesWithAnd() Returns the list of authors separated by "and"s with first names before last name; first names are not abbreviated.
| |
| getAsLastFirstFirstLastNamesWithAnd | back to summary |
|---|---|
| public String getAsLastFirstFirstLastNamesWithAnd(boolean abbreviate) Returns a list of authors separated with "and". The first author is formatted with
| |
| getAsLastFirstNames | back to summary |
|---|---|
| public String getAsLastFirstNames(boolean abbreviate, boolean oxfordComma) Returns the list of authors separated by commas with first names after last name; first names are abbreviated or not depending on parameter. If the list consists of three or more authors, "and" is inserted before the last author's name.
| |
| getAsLastFirstNamesWithAnd | back to summary |
|---|---|
| public String getAsLastFirstNamesWithAnd(boolean abbreviate) Returns the list of authors separated by "and"s with first names after last name; first names are not abbreviated.
| |
| getAsLastNames | back to summary |
|---|---|
| public String getAsLastNames(boolean oxfordComma) Returns the list of authors separated by commas with last name only; If the list consists of two or more authors, "and" is inserted before the last author's name.
| |
| getAsNatbib | back to summary |
|---|---|
| public String getAsNatbib() Returns the list of authors in "natbib" format.
| |
| getAuthor | back to summary |
|---|---|
| public Author getAuthor(int i) Returns the
| |
| getAuthors | back to summary |
|---|---|
| public List Returns the list of | |
| getForAlphabetization | back to summary |
|---|---|
| public String getForAlphabetization() Returns the list of authors in a form suitable for alphabetization. This means that last names come first, never preceded by "von" particles, and that any braces are removed. First names are abbreviated so the same name is treated similarly if abbreviated in one case and not in another. This form is not intended to be suitable for presentation, only for sorting.
| |
| getNumberOfAuthors | back to summary |
|---|---|
| public int getNumberOfAuthors() Returns the number of author names in this object.
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| isEmpty | back to summary |
|---|---|
| public boolean isEmpty() Returns true if there are no authors in the list.
| |
| iterator | back to summary |
|---|---|
| public Iterator Implements java. Doc from java. Returns an iterator over elements of type
| |
| latexFree | back to summary |
|---|---|
| public AuthorList latexFree() Returns a LaTeX-free version of this | |
| of | back to summary |
|---|---|
| public static AuthorList of(List<Author> authors) | |
| of | back to summary |
|---|---|
| public static AuthorList of(Author... authors) | |
| parse | back to summary |
|---|---|
| public static AuthorList parse(final @NonNull String authors) Retrieve an AuthorList for the given string of authors or editors. This function tries to cache the parsed AuthorLists by the string passed in.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non-
| |