no.uio.edd.model.geo
Class GeoModelPerson

java.lang.Object
  extended by no.uio.edd.model.geo.GeoModelPerson
All Implemented Interfaces:
GeoModelLinkable

public class GeoModelPerson
extends java.lang.Object
implements GeoModelLinkable

Store a set of information about one person. corefId will default to self, but can be changed, and will then be saved and loaded.

Author:
oeide

Field Summary
(package private)  ExtendableObjectList corefBackList
           
 
Constructor Summary
GeoModelPerson(org.w3c.dom.Element rootNode, GeoModelPersonReg inSchnitlerPersonReg)
          Create a person object.
 
Method Summary
 boolean addCorefBacklink(java.lang.String corefId)
          Add a link to the list of objects corefering to this.
(package private)  int addNameNode(GeoModelLinkable nameNode)
          Adds name element to this person object.
(package private)  int addSpeakerNode(GeoModelLinkable speakerNode)
          Adds a speaker element to this person object, that is, a paragraph level element for which this person is seen as the speaker.
(package private)  java.lang.String formatPersonFull()
          A report for a person.
(package private)  java.lang.String formatPersonFullHtmlCore()
          A HTML report for a person.
(package private)  java.lang.String formatPersonFullWithText()
          Give all output on a person, including all spoken text.
(package private)  java.lang.String formatPersonFullWithTextHtml()
          Give all output on a person in HTML, including all spoken text and the links connecting this person.
(package private)  java.lang.String formatPersonSpeaker()
          Format up to 20 paragraphs of speech for a person.
 java.lang.String[] getCorefBacklinkList()
          Return the list of object IDs corefering to this.
 java.lang.String getCorefId()
          Any linkable object has a global ID that can be used in co-reference work.
 java.lang.String getHtmlTableTr()
          Returns a string with a line for a HTML table giving core information about the object: 1) ID. 2) textual representation. 3) main paragraph level connection (if applicable). 4) page (if applicable).
 java.lang.String getId()
          Find the global ID value for this object.
 java.lang.String getIdOfPara()
          Return the id of the paragraph element this object is connected to, if applicable.
 ExtendableStringList getIdToParasWhereIAmSpeaker()
           
 java.lang.String getInfoHtml()
          Returns a string with a fact sheet on the object in HTML.
(package private)  java.lang.String getMainName()
           
(package private)  GeoModelPersonReg getMyOwner()
           
 java.lang.String getName()
           
(package private)  int getOrigIdNum()
           
 ExtendableObjectList getParasWhereIAmSpeaker()
           
(package private)  java.lang.String getRdf()
           
(package private)  int getSpeakerNodeCount()
           
(package private)  java.lang.String getSpeakerStatisticsLine()
           
 boolean removeCorefBacklink(java.lang.String corefId)
          Remove a link from the list of objects corefering to this.
 boolean removeObject()
          Remove this object from the data set.
 boolean setCorefId(java.lang.String corefId)
          Any linkable object has a global ID that can be used in co-reference work.
 boolean setCorefId(java.lang.String corefId, long corefDate)
          Any linkable object has a global ID that can be used in co-reference work.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

corefBackList

ExtendableObjectList corefBackList
Constructor Detail

GeoModelPerson

GeoModelPerson(org.w3c.dom.Element rootNode,
               GeoModelPersonReg inSchnitlerPersonReg)
Create a person object.

Parameters:
rootNode - The TEI person element representing this person.
inSchnitlerPersonReg - The object controlling all the person objects.
Method Detail

addNameNode

int addNameNode(GeoModelLinkable nameNode)
          throws javax.xml.datatype.DatatypeConfigurationException
Adds name element to this person object.

Parameters:
nameNode - The node representing the name.
Returns:
The number of names recorded for this person.
Throws:
javax.xml.datatype.DatatypeConfigurationException - Thrown if the nameNode parameter is not of a type storable as a person name.

addSpeakerNode

int addSpeakerNode(GeoModelLinkable speakerNode)
             throws javax.xml.datatype.DatatypeConfigurationException
Adds a speaker element to this person object, that is, a paragraph level element for which this person is seen as the speaker.

Parameters:
speakerNode - The node representing the paragraph.
Returns:
The number of paragraph level elements recorded for this person.
Throws:
javax.xml.datatype.DatatypeConfigurationException - Thrown if the speakerNode parameter is not of a type storable as a person name.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

formatPersonFull

java.lang.String formatPersonFull()
A report for a person.

Returns:
A string with a printable report for the person information.

formatPersonFullHtmlCore

java.lang.String formatPersonFullHtmlCore()
A HTML report for a person.

Returns:
A string with a HTML report for the person information.

formatPersonSpeaker

java.lang.String formatPersonSpeaker()
Format up to 20 paragraphs of speech for a person.

Returns:
A string with a printable report for the person information.

formatPersonFullWithText

java.lang.String formatPersonFullWithText()
Give all output on a person, including all spoken text.

Returns:
A string with a printable report for the person information.

formatPersonFullWithTextHtml

java.lang.String formatPersonFullWithTextHtml()
Give all output on a person in HTML, including all spoken text and the links connecting this person.

Returns:
A string with a HTML version of the report for the person information.

getOrigIdNum

int getOrigIdNum()
Returns:
The number part of the ID from the TEI file.

getMainName

java.lang.String getMainName()
Returns:
Get the main name for this person.

getId

public java.lang.String getId()
Description copied from interface: GeoModelLinkable
Find the global ID value for this object.

Specified by:
getId in interface GeoModelLinkable
Returns:
The ID value for the linkable object.

getCorefId

public java.lang.String getCorefId()
Description copied from interface: GeoModelLinkable
Any linkable object has a global ID that can be used in co-reference work. In some cases (e.g. person elements) this is the object's own ID. In other cases, such as rs'es, it is the ID of a person or place element, or even another rs or name referring to the same real world object.

Specified by:
getCorefId in interface GeoModelLinkable
Returns:
The co-reference ID value.

removeObject

public boolean removeObject()
Description copied from interface: GeoModelLinkable
Remove this object from the data set.

Specified by:
removeObject in interface GeoModelLinkable
Returns:
True if removed, false if the object is not removable.

getRdf

java.lang.String getRdf()

setCorefId

public boolean setCorefId(java.lang.String corefId)
Description copied from interface: GeoModelLinkable
Any linkable object has a global ID that can be used in co-reference work. In some cases (e.g. person elements) this is the object's own ID. In other cases, such as rs'es, it is the ID of a person or place element, or even another rs or name referring to the same real world object.

Specified by:
setCorefId in interface GeoModelLinkable
Parameters:
corefId - The new co-reference ID value.
Returns:
True on success.

setCorefId

public boolean setCorefId(java.lang.String corefId,
                          long corefDate)
Any linkable object has a global ID that can be used in co-reference work. In some cases (e.g. person elements) this is the object's own ID. In other cases, such as rs'es, it is the ID of a person or place element, or even another rs or name referring to the same real world object. This version with date is used when read from file.

Parameters:
corefId - The new co-reference ID value.
corefDate - The date the coref was set
Returns:
True on success.

getSpeakerNodeCount

int getSpeakerNodeCount()

getInfoHtml

public java.lang.String getInfoHtml()
Description copied from interface: GeoModelLinkable
Returns a string with a fact sheet on the object in HTML.

Specified by:
getInfoHtml in interface GeoModelLinkable
Returns:
The HTML string.

getMyOwner

GeoModelPersonReg getMyOwner()

addCorefBacklink

public boolean addCorefBacklink(java.lang.String corefId)
Description copied from interface: GeoModelLinkable
Add a link to the list of objects corefering to this.

Specified by:
addCorefBacklink in interface GeoModelLinkable
Parameters:
corefId - The ID of the coref.
Returns:
True on success.

getCorefBacklinkList

public java.lang.String[] getCorefBacklinkList()
Description copied from interface: GeoModelLinkable
Return the list of object IDs corefering to this.

Specified by:
getCorefBacklinkList in interface GeoModelLinkable
Returns:
The list.

removeCorefBacklink

public boolean removeCorefBacklink(java.lang.String corefId)
Description copied from interface: GeoModelLinkable
Remove a link from the list of objects corefering to this.

Specified by:
removeCorefBacklink in interface GeoModelLinkable
Parameters:
corefId - The ID of the coref.
Returns:
True on success.

getIdOfPara

public java.lang.String getIdOfPara()
Description copied from interface: GeoModelLinkable
Return the id of the paragraph element this object is connected to, if applicable.

Specified by:
getIdOfPara in interface GeoModelLinkable
Returns:
The ID of the para element. Null if not applicable.

getSpeakerStatisticsLine

java.lang.String getSpeakerStatisticsLine()

getHtmlTableTr

public java.lang.String getHtmlTableTr()
Description copied from interface: GeoModelLinkable
Returns a string with a line for a HTML table giving core information about the object: 1) ID. 2) textual representation. 3) main paragraph level connection (if applicable). 4) page (if applicable).

Specified by:
getHtmlTableTr in interface GeoModelLinkable
Returns:
A tr html fragment.

getParasWhereIAmSpeaker

public ExtendableObjectList getParasWhereIAmSpeaker()
Returns:
A list of objects of the type GeoModelElement representing the paragraphs for which I am the speaker.

getIdToParasWhereIAmSpeaker

public ExtendableStringList getIdToParasWhereIAmSpeaker()

getName

public java.lang.String getName()
Specified by:
getName in interface GeoModelLinkable
Returns:
A name representing this object. Can be an empty string if it has no name.