Textractor API textractor-720 (20091120123250)

textractor.datamodel
Class Author

java.lang.Object
  extended by textractor.datamodel.Author
All Implemented Interfaces:
Serializable

public class Author
extends Object
implements Serializable

An author for an Article.

Author:
Kevin Dorff
See Also:
Serialized Form

Field Summary
static MutableString EMPTY_MUTABLE_STRING
          An empty mutable string.
 
Constructor Summary
Author(String fullName)
          An author will full name such as "Michael J.
Author(String lastNameVal, String firstNameVal, String initialsVal)
          Constructor.
 
Method Summary
static MutableString getAuthorsIndexText(List<Author> authors)
          Given a list of authors, reutrn the index text for the entire list.
 String getFirstName()
          Get the author's first name.
 String getIndexableText()
          The text that represents this author, used for indexing.
 String getInitials()
          Get the author's initials.
 String getLastName()
          Get the author's last name.
static String indexableName(String originalName)
           
static String makeInitials(String firstNameVal, String initialsVal)
          Given firstNameVal and initialsVal, return the initials for the author.
 String toString()
          Human readable version of this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

EMPTY_MUTABLE_STRING

public static final MutableString EMPTY_MUTABLE_STRING
An empty mutable string.

Constructor Detail

Author

public Author(String lastNameVal,
              String firstNameVal,
              String initialsVal)
Constructor.

Parameters:
lastNameVal - the author's last name
firstNameVal - the author's first name
initialsVal - the author's initials (if not provided they will be created based on the value in firstNameVal)

Author

public Author(String fullName)
An author will full name such as "Michael J. Fox". Any part of the name may be missing. This will parse to Firstname="Michael J", Initials="MJ", Lastname="Fox".

Parameters:
fullName - the authors full name.
Method Detail

getLastName

public String getLastName()
Get the author's last name.

Returns:
the

getFirstName

public String getFirstName()
Get the author's first name.

Returns:
the author's first name

getInitials

public String getInitials()
Get the author's initials.

Returns:
the author's initials

makeInitials

public static String makeInitials(String firstNameVal,
                                  String initialsVal)
Given firstNameVal and initialsVal, return the initials for the author.

Parameters:
firstNameVal - the first name to use as a fallback value for the initials in the case that initialsVal is null or empty
initialsVal - the authors initials
Returns:
the authors initials

getIndexableText

public String getIndexableText()
The text that represents this author, used for indexing.

Returns:
the indexing text

indexableName

public static String indexableName(String originalName)

getAuthorsIndexText

public static MutableString getAuthorsIndexText(List<Author> authors)
Given a list of authors, reutrn the index text for the entire list.

Parameters:
authors - the list of authors
Returns:
the index string for all of them.

toString

public String toString()
Human readable version of this object.

Overrides:
toString in class Object
Returns:
this object as a human readable string

Textractor API textractor-720 (20091120123250)

Copyright © 2003-2008 Institute for Computational Biomedicine, All Rights Reserved.