edu.uchsc.ccp.knowtator.textsource
Interface TextSource

All Known Implementing Classes:
DefaultTextSource, FileLineTextSource, FileTextSource, GeneRIFTextSource

public interface TextSource

We recommend that instead of implementing this interface that you extend DefaultTextSource. If you decide to implement this interface directly we encourage you to look at the code for DefaultTextSource to help you.


Method Summary
 Instance createTextSourceInstance(KnowledgeBase knowledgeBase)
          This is the generic method for creating a "knowtator text source" instance from a TextSource object.
 boolean equals(Object object)
           
 String getName()
           
 String getProtegeClsName()
          Every implementation of TextSource corresponds to a subclass of "knowtator text source" which is a class defined knowtator.pprj (which is the project that must be included in order to run Knowtator.)
 String getText()
           
 String getText(List<Span> spans)
          Returns the text corresponding to the spans passed in.
 int hashCode()
           
 String toString()
           
 

Method Detail

getText

String getText()
               throws TextSourceAccessException
Returns:
the text associated with the TextSource. The text returned will be shown in the Knowtator text viewer.
Throws:
TextSourceAccessException

getName

String getName()
Returns:
the name associated with the TextSource. This should be thought of as an identifier for the TextSource. Implementations of TextSourceCollection should make sure that name collisions do not occur.

getProtegeClsName

String getProtegeClsName()
Every implementation of TextSource corresponds to a subclass of "knowtator text source" which is a class defined knowtator.pprj (which is the project that must be included in order to run Knowtator.)


createTextSourceInstance

Instance createTextSourceInstance(KnowledgeBase knowledgeBase)
This is the generic method for creating a "knowtator text source" instance from a TextSource object. All instances of "knowtator text source" can be created in a very simplistic way from a TextSource object. An instance of the class specified by the name returned by getProtegeClsName() is created with the name returned by getName()

Returns:
may return null if textSource.getProtegeClsName() is not a known cls name. Otherwise the new Protege instance that has been created.

hashCode

int hashCode()
Overrides:
hashCode in class Object

equals

boolean equals(Object object)
Overrides:
equals in class Object

toString

String toString()
Overrides:
toString in class Object

getText

String getText(List<Span> spans)
               throws TextSourceAccessException
Returns the text corresponding to the spans passed in. Typically, a single span will be passed in and the text corresponding to that text will be returned. If there are multiple spans, some extra decisions need to be made such as what the delimiter between spans will be and whether the spans should be sorted first.

Throws:
TextSourceAccessException