net.sourceforge.nite.nom.nomwrite.impl
Class NOMWritePointer

java.lang.Object
  extended by net.sourceforge.nite.nom.nomwrite.impl.NOMWritePointer
All Implemented Interfaces:
NOMPointer
Direct Known Subclasses:
NOMReadPointer

public class NOMWritePointer
extends java.lang.Object
implements NOMPointer

A simple implementation of a pointer in a NOM corpus.

Author:
jonathan

Nested Class Summary
 class NOMWritePointer.SharedPointer
          This inner class provides a utility function for shared NOM users
 
Nested classes/interfaces inherited from interface net.sourceforge.nite.nom.nomwrite.NOMPointer
NOMPointer.SharedPoint
 
Constructor Summary
NOMWritePointer(NOMCorpus corpus, java.lang.String role, NOMElement source, NOMElement target)
           
NOMWritePointer(NOMCorpus corpus, java.lang.String role, NOMElement source, java.lang.String targetstr)
           
 
Method Summary
 java.lang.String getComment()
          returns the contents of the reserved comment String (or null if not set)
 NOMCorpus getCorpus()
          Simply return the Corpus that this pointer is a part of
 NOMElement getFromElement()
          returns the element which is the source of the pointer
 java.lang.String getLink()
          Return the full link to the pointed to element
 java.lang.String getRole()
          returns the role of the pointer
 NOMPointer.SharedPoint getShared()
          return a shared view of this pointer which simply provides a utility function for editing the pointer without thinking about locking and unlocking the corpus.
 NOMElement getToElement()
          returns the element which is the destination of the pointer
 java.lang.String getToElementString()
          returns the element which is the destination of the pointer as a string (the original href string from the loaded corpus)
 void setComment(java.lang.String comment)
          set the contents of the reserved comment attribute
 void setRole(java.lang.String role)
          set the role of this pointer
 void setToElement(NOMElement targ)
          set the element to which this pointer points
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NOMWritePointer

public NOMWritePointer(NOMCorpus corpus,
                       java.lang.String role,
                       NOMElement source,
                       java.lang.String targetstr)

NOMWritePointer

public NOMWritePointer(NOMCorpus corpus,
                       java.lang.String role,
                       NOMElement source,
                       NOMElement target)
Method Detail

getRole

public java.lang.String getRole()
returns the role of the pointer

Specified by:
getRole in interface NOMPointer

getFromElement

public NOMElement getFromElement()
returns the element which is the source of the pointer

Specified by:
getFromElement in interface NOMPointer

getToElement

public NOMElement getToElement()
returns the element which is the destination of the pointer

Specified by:
getToElement in interface NOMPointer

getCorpus

public NOMCorpus getCorpus()
Simply return the Corpus that this pointer is a part of


setRole

public void setRole(java.lang.String role)
set the role of this pointer

Specified by:
setRole in interface NOMPointer

setToElement

public void setToElement(NOMElement targ)
                  throws NOMException
set the element to which this pointer points

Specified by:
setToElement in interface NOMPointer
Throws:
NOMException

getToElementString

public java.lang.String getToElementString()
returns the element which is the destination of the pointer as a string (the original href string from the loaded corpus)

Specified by:
getToElementString in interface NOMPointer

getLink

public java.lang.String getLink()
Return the full link to the pointed to element

Specified by:
getLink in interface NOMPointer

getShared

public NOMPointer.SharedPoint getShared()
return a shared view of this pointer which simply provides a utility function for editing the pointer without thinking about locking and unlocking the corpus.

Specified by:
getShared in interface NOMPointer

getComment

public java.lang.String getComment()
returns the contents of the reserved comment String (or null if not set)

Specified by:
getComment in interface NOMPointer

setComment

public void setComment(java.lang.String comment)
set the contents of the reserved comment attribute

Specified by:
setComment in interface NOMPointer