edu.northwestern.at.morphadorner.tei

## Class TEIHeaderAuthor

- java.lang.Object
- - edu.northwestern.at.morphadorner.tei.TEIHeaderAuthor

- All Implemented Interfaces:
    java.lang.Comparable

      public class TEIHeaderAuthor
      extends java.lang.Object
      implements java.lang.Comparable

  Holds selected "TEIHeader" author information from an adorned TEI XML file.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected java.util.Map<java.lang.String,java.lang.String>` | `authorMap` Author map.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `TEIHeaderAuthor(java.util.Map<java.lang.String,java.lang.String> authorMap)` Create author map.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `compare(TEIHeaderAuthor a1, TEIHeaderAuthor a2)` Compare two authors for order.
    `int` | `compareTo(java.lang.Object object)` Compare this object with another.
    `boolean` | `equals(java.lang.Object obj)` Two authors are the same if all their details agree.
    `java.lang.String` | `getName()` Get author name.
    `protected java.lang.String` | `safeString(java.lang.String s)` Return string ensuring null is set to empty string.
    `java.lang.String` | `toString()` Return author name as string.

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### authorMap

          protected java.util.Map<java.lang.String,java.lang.String> authorMap

      Author map.

  - ### Constructor Detail

    - #### TEIHeaderAuthor

          public TEIHeaderAuthor(java.util.Map<java.lang.String,java.lang.String> authorMap)

      Create author map.
      Parameters:
        `authorMap` - The author map.

  - ### Method Detail

    - #### getName

          public java.lang.String getName()

      Get author name.
      Returns:
        The name of the work's author.

    - #### safeString

          protected java.lang.String safeString(java.lang.String s)

      Return string ensuring null is set to empty string.
      Parameters:
        `s` - String to check.
      Returns:
        Original value of "s" if s is not null, or empty string if "s" is null.

    - #### toString

          public java.lang.String toString()

      Return author name as string.
      Overrides:
        `toString` in class `java.lang.Object`
      Returns:
        Author name.

    - #### compareTo

          public int compareTo(java.lang.Object object)

      Compare this object with another.
      Specified by:
        `compareTo` in interface `java.lang.Comparable`
      Parameters:
        `object` - The other object.
      Returns:
        < 0 if the other object is less than this one, = 0 if the two objects are equal, > 0 if the other object is greater than this one.

    - #### compare

          public int compare(TEIHeaderAuthor a1,
                    TEIHeaderAuthor a2)

      Compare two authors for order.
      Parameters:
        `a1` - First author.
        `a2` - Second author.
      Returns:
        < 0 if the other object is less than this one, = 0 if the two objects are equal, > 0 if the other object is greater than this one.

    - #### equals

          public boolean equals(java.lang.Object obj)

      Two authors are the same if all their details agree.
      Overrides:
        `equals` in class `java.lang.Object`
      Parameters:
        `obj` - Object to compare for equality to this one,
      Returns:
        True if the two authors are the same.

        Two authors are assumed to be the same if all their details agree.