net.sourceforge.nite.nom.nomwrite
Interface NOMContext

All Known Implementing Classes:
NOMWriteContext

public interface NOMContext

NOMContext holds information about the currently loaded files. It is mainly useful when resource files are being used, but can also show reliability syle loads using the older metadata approach.

Author:
jonathan

Field Summary
static int METADATA
           
static int METADATA_MULTI
           
static int RESOURCE
           
static int RESOURCE_MULTI
           
static int UNLOADED
           
 
Method Summary
 void addFile(java.lang.String observation, NFile nfile, java.lang.String filename, int type, NResource resource, java.lang.String annotator)
          add a loaded file to the context store - caller must work out type and should pass resource only if it's a resource load and annotator only if it's an old-style multi-annotator load.
 void clear()
          clear information about loaded data
 void clear(java.lang.String observation)
          clear information about loaded data for the given observation
 java.util.List getAnnotators(java.lang.String observation, NFile nfile)
          only returns a non-null List if the load type is METADATA_MULTI - if so, returns a List of String elements: the annotators IDs
 java.util.List getLoadedNFilesForObservation(java.lang.String observation)
          return a List of NFile elements that have some loaded data corresponding to them for the given observation name.
 java.util.List getLoadedObservationNames()
           
 int getLoadType(java.lang.String observation, NFile nfile)
           
 NResource getResource(java.lang.String observation, NFile nfile)
          only returns a non-null List if the load type RESOURCE - if so, returns the NResource itself
 java.util.List getResourceDescriptions(java.lang.String observation, NFile nfile)
          Only returns a non-null List if the type is RESOURCE or RESOURCE_MULTI - return all resources loaded for this combination of observation and NFile as a List of Strings: the result of calling getDescription on each NResource.
 java.util.List getResourceIDs(java.lang.String observation, NFile nfile)
          Only returns a non-null List if the type is RESOURCE or RESOURCE_MULTI - return all resources loaded for this combination of observation and NFile as a List of Strings: the result of calling getID on each NResource.
 java.util.Set getResources(java.lang.String observation, NFile nfile)
          Only returns a non-null Set if the type is RESOURCE or RESOURCE_MULTI - return all resources loaded for this combination of observation and NFile as a Set of NResource elements.
 java.lang.String getTextualContext()
          return a String containing the context in plain text - formatted for human reading
 java.util.List getUnloadedNFilesForObservation(java.lang.String observation)
          return a List of NFile elements that have no loaded data corresponding to them for the given observation name.
 java.lang.String getXMLContext()
          return an XML formatted String containing the context
 

Field Detail

UNLOADED

static final int UNLOADED
See Also:
Constant Field Values

METADATA

static final int METADATA
See Also:
Constant Field Values

METADATA_MULTI

static final int METADATA_MULTI
See Also:
Constant Field Values

RESOURCE

static final int RESOURCE
See Also:
Constant Field Values

RESOURCE_MULTI

static final int RESOURCE_MULTI
See Also:
Constant Field Values
Method Detail

getLoadedObservationNames

java.util.List getLoadedObservationNames()

getLoadType

int getLoadType(java.lang.String observation,
                NFile nfile)

getAnnotators

java.util.List getAnnotators(java.lang.String observation,
                             NFile nfile)
only returns a non-null List if the load type is METADATA_MULTI - if so, returns a List of String elements: the annotators IDs


getResource

NResource getResource(java.lang.String observation,
                      NFile nfile)
only returns a non-null List if the load type RESOURCE - if so, returns the NResource itself


getResources

java.util.Set getResources(java.lang.String observation,
                           NFile nfile)
Only returns a non-null Set if the type is RESOURCE or RESOURCE_MULTI - return all resources loaded for this combination of observation and NFile as a Set of NResource elements.


getResourceDescriptions

java.util.List getResourceDescriptions(java.lang.String observation,
                                       NFile nfile)
Only returns a non-null List if the type is RESOURCE or RESOURCE_MULTI - return all resources loaded for this combination of observation and NFile as a List of Strings: the result of calling getDescription on each NResource.


getResourceIDs

java.util.List getResourceIDs(java.lang.String observation,
                              NFile nfile)
Only returns a non-null List if the type is RESOURCE or RESOURCE_MULTI - return all resources loaded for this combination of observation and NFile as a List of Strings: the result of calling getID on each NResource.


getLoadedNFilesForObservation

java.util.List getLoadedNFilesForObservation(java.lang.String observation)
return a List of NFile elements that have some loaded data corresponding to them for the given observation name. This will not contain any corpus level files loaded unless the observation String is null.


getUnloadedNFilesForObservation

java.util.List getUnloadedNFilesForObservation(java.lang.String observation)
return a List of NFile elements that have no loaded data corresponding to them for the given observation name. This will not contain any unloaded corpus level files unless the observation String is null.


getTextualContext

java.lang.String getTextualContext()
return a String containing the context in plain text - formatted for human reading


getXMLContext

java.lang.String getXMLContext()
return an XML formatted String containing the context


clear

void clear()
clear information about loaded data


clear

void clear(java.lang.String observation)
clear information about loaded data for the given observation


addFile

void addFile(java.lang.String observation,
             NFile nfile,
             java.lang.String filename,
             int type,
             NResource resource,
             java.lang.String annotator)
add a loaded file to the context store - caller must work out type and should pass resource only if it's a resource load and annotator only if it's an old-style multi-annotator load.