edu.uchsc.ccp.knowtator.textsource.filelines
Class FileLinesTextSourceCollection

java.lang.Object
  extended by edu.uchsc.ccp.knowtator.textsource.TextSourceCollection
      extended by edu.uchsc.ccp.knowtator.textsource.filelines.FileLinesTextSourceCollection
Direct Known Subclasses:
GeneRIFTextSourceCollection

public class FileLinesTextSourceCollection
extends TextSourceCollection


Field Summary
static String CLS_NAME
           
static String DISPLAY_NAME
           
protected  Map<String,TextSource> namesToTextSource
           
static String PROJECT_SETTING_RECENT_FILE
           
protected  Map<TextSource,Integer> textSourceToIndex
           
 
Constructor Summary
FileLinesTextSourceCollection(File file)
           
FileLinesTextSourceCollection(String fileName)
           
 
Method Summary
static void createCls(KnowledgeBase kb)
           
protected  TextSource createTextSource(String fileLine)
           
 TextSource find(Component parent)
           
 TextSource get(int index)
           
 TextSource get(String name)
           
 File getFile()
           
 int getIndex(TextSource textSource)
           
 String getName()
           
 TextSourceIterator iterator()
          provides an easy way for a script to iterate through all TextSources in a collection.
static TextSourceCollection open(Project project)
           
static TextSourceCollection open(Project project, Component parent)
           
 void save(Project project)
          This method saves information about this text source collection to the Protege project.
 TextSource select(Component parent)
           
 int size()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DISPLAY_NAME

public static final String DISPLAY_NAME
See Also:
Constant Field Values

CLS_NAME

public static final String CLS_NAME
See Also:
Constant Field Values

PROJECT_SETTING_RECENT_FILE

public static final String PROJECT_SETTING_RECENT_FILE

namesToTextSource

protected Map<String,TextSource> namesToTextSource

textSourceToIndex

protected Map<TextSource,Integer> textSourceToIndex
Constructor Detail

FileLinesTextSourceCollection

public FileLinesTextSourceCollection(String fileName)
                              throws IOException
Throws:
IOException

FileLinesTextSourceCollection

public FileLinesTextSourceCollection(File file)
                              throws IOException
Throws:
IOException
Method Detail

createTextSource

protected TextSource createTextSource(String fileLine)

getFile

public File getFile()

get

public TextSource get(int index)
               throws TextSourceAccessException
Specified by:
get in class TextSourceCollection
Throws:
TextSourceAccessException

size

public int size()
Specified by:
size in class TextSourceCollection

getName

public String getName()
Specified by:
getName in class TextSourceCollection
Returns:
The name of the text source collection. Might correspond to the name of the directory, database or file that the text source collection accesses to get text sources.

getIndex

public int getIndex(TextSource textSource)
Specified by:
getIndex in class TextSourceCollection
Returns:
-1 if text source does not exist.

get

public TextSource get(String name)
               throws TextSourceAccessException
Specified by:
get in class TextSourceCollection
Returns:
the text source that has the given name. A text source collection should have no name collisions.
Throws:
TextSourceAccessException

select

public TextSource select(Component parent)
Specified by:
select in class TextSourceCollection
Returns:
a TextSource selected by a human user through a user interface. Implementations of this method might provide a dialog with a list of available text sources.

find

public TextSource find(Component parent)
Specified by:
find in class TextSourceCollection
Returns:
a TextSource selected by a human user through a user interface. Implementations of this method might provide a dialog with a text field that requires the user to enter the name of a text source or some text that s/he is looking for.

save

public void save(Project project)
Description copied from class: TextSourceCollection
This method saves information about this text source collection to the Protege project. The information saved should be sufficient to reinstantiate this text source collection the next time Protege is started.

Specified by:
save in class TextSourceCollection

open

public static TextSourceCollection open(Project project)

open

public static TextSourceCollection open(Project project,
                                        Component parent)

iterator

public TextSourceIterator iterator()
Description copied from class: TextSourceCollection
provides an easy way for a script to iterate through all TextSources in a collection.

Specified by:
iterator in class TextSourceCollection

createCls

public static void createCls(KnowledgeBase kb)