no.uio.edd.model.geo
Class GeoModelElement

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

public class GeoModelElement
extends java.lang.Object
implements GeoModelLinkable, EddChainable

A kind of a wrapper class around a DOM Element so that the local interface can be added easily. Coref id may be of two different types: 1) the ID of the myPersonElement. If this exist, the corefId will be immutable. 2) Othervise, corefId will default to self, but can be changed, and will then be saved and loaded.

Author:
oeide

Field Summary
(package private)  ExtendableObjectList corefBackList
           
(package private)  java.lang.String corefId
           
(package private)  org.w3c.dom.Element myDomElement
           
(package private)  GeoModelPerson myPersonElement
           
(package private)  GeoModelElement nextGeoModelElement
           
 
Constructor Summary
GeoModelElement(GeoModelRunner inGeoModelRunner, org.w3c.dom.Element inSchnitlerElement)
          Create a wrapper object.
 
Method Summary
 boolean addCorefBacklink(java.lang.String corefId)
          Add a link to the list of objects corefering to this.
 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.
 java.lang.String getInfoHtml()
          Returns a string with a fact sheet on the object in HTML.
(package private)  GeoModelPerson getMyPersonElement()
          If I am a persName node, and I have a person element connected to me, that one is returned.
 java.lang.String getName()
           
(package private)  java.lang.String getRdf()
           
 java.lang.String getType()
           
 EddChainable next()
          Get the next object in the chain.
 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.
(package private)  void setMyPersonElement(GeoModelPerson newElem)
          If I am a persName node, this sets the link to my related person element.
 void setNext(EddChainable newNext)
          Set the pointer to the next object in the chain.
(package private)  void setNextElement(GeoModelElement inNextGeoModelElement)
          Adds a pointer to another element
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

myDomElement

org.w3c.dom.Element myDomElement

nextGeoModelElement

GeoModelElement nextGeoModelElement

myPersonElement

GeoModelPerson myPersonElement

corefId

java.lang.String corefId

corefBackList

ExtendableObjectList corefBackList
Constructor Detail

GeoModelElement

public GeoModelElement(GeoModelRunner inGeoModelRunner,
                       org.w3c.dom.Element inSchnitlerElement)
Create a wrapper object.

Parameters:
inGeoModelRunner - The runner owning this object.
inSchnitlerElement - The DOM Element to be wrapped.
Method Detail

getMyPersonElement

GeoModelPerson getMyPersonElement()
If I am a persName node, and I have a person element connected to me, that one is returned.

Returns:
My person element; if none found, null is returned.

setMyPersonElement

void setMyPersonElement(GeoModelPerson newElem)
If I am a persName node, this sets the link to my related person element.

Parameters:
newElem - My person element.

setNextElement

void setNextElement(GeoModelElement inNextGeoModelElement)
Adds a pointer to another element

Parameters:
inNextGeoModeElement - The element pointed to.

toString

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

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.

getRdf

java.lang.String getRdf()

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.

next

public EddChainable next()
Description copied from interface: EddChainable
Get the next object in the chain.

Specified by:
next in interface EddChainable
Returns:
The next object.

setNext

public void setNext(EddChainable newNext)
Description copied from interface: EddChainable
Set the pointer to the next object in the chain.

Specified by:
setNext in interface EddChainable
Parameters:
newNext - New value for the next object pointer.

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.

getInfoHtml

public java.lang.String getInfoHtml()
Returns a string with a fact sheet on the object in HTML.

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

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.

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.

getType

public java.lang.String getType()
Returns:
A string representing the type of this node. It will be the element type; if name, the type of the name.

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.