net.sourceforge.nite.meta
Interface NResourceData

All Known Implementing Classes:
NiteResourceData

public interface NResourceData

Handles any resource file associated with a corpus: if present this must define all the information about where on disk codings live, and what competing versions of annotations exist.

Author:
jonathan

Method Summary
 void addResource(java.lang.String coding, NResource resource)
          add a new resource
 void addResourceGroup(NResourceGroup nrg)
          add a NResourceGroup element for resources that instantiate the named coding.
 void deleteResource(java.lang.String resourceid)
          delete resource given its ID
 java.util.List getCoherentResourceGroups(java.lang.String coding)
          Return the full list of real resources for a coding, except that if there are virtual resources, add them to the list and remove any resources they draw from.
 java.util.List getCoherentResourceGroups(java.lang.String coding, java.lang.String observation)
          Return the full list of real resources, except that if there are virtual resources, add them to the list and remove any resources they draw from.
 java.util.List getDefaultedResourcesForCoding(java.lang.String coding)
          find a list of NResource elements that instantiate the named coding and have their default attribute set to true.
 java.util.List getIncompatibleResources(NResource res)
          get a List of NResource elements that are incompatible with this one
 NResource getResourceByID(java.lang.String rid)
          find a resource from its ID
 java.lang.String getResourceFilePath()
          Return the path to the resource file (absolute)
 NResourceGroup getResourceGroupForCoding(java.lang.String coding)
          find a NResourceGroup elements that instantiate the named coding.
 java.lang.String getResourcePath(NResource resource)
          find the path to the resource: each resource has one location on disk which can be affected by: the location of the resource file (if paths are relative); the 'path' attribute of the resource-type element in the resource file; the 'path' attribute of the 'resource' element
 java.lang.String getResourcePath(java.lang.String resourceid)
          find the path to the resource: each resource has one location on disk which can be affected by: the location of the resource file (if paths are relative); the 'path' attribute of the resource-type element in the resource file; the 'path' attribute of the 'resource' element
 java.util.List getResourcesForCoding(java.lang.String coding)
          find a list of NResource elements that instantiate the named coding.
 java.util.List getVirtualResourcesForCoding(java.lang.String coding)
          find a list of NVirtualResource elements that instantiate the named coding
 void setFilename(java.lang.String filename)
          set the resource filename for any future save: relative paths are assumed to be relative to the metadata directory.
 void writeResourceFile()
          save the resource file to the current filename (by default the file it was created from, or set using setFilename).
 void writeResourceFile(java.lang.String filename)
          save the resource file to a file with the given filename.
 

Method Detail

getResourceByID

NResource getResourceByID(java.lang.String rid)
find a resource from its ID


getResourcesForCoding

java.util.List getResourcesForCoding(java.lang.String coding)
find a list of NResource elements that instantiate the named coding. If there are zero, return null.


getDefaultedResourcesForCoding

java.util.List getDefaultedResourcesForCoding(java.lang.String coding)
find a list of NResource elements that instantiate the named coding and have their default attribute set to true. If there are zero, return null.


getVirtualResourcesForCoding

java.util.List getVirtualResourcesForCoding(java.lang.String coding)
find a list of NVirtualResource elements that instantiate the named coding


getCoherentResourceGroups

java.util.List getCoherentResourceGroups(java.lang.String coding)
Return the full list of real resources for a coding, except that if there are virtual resources, add them to the list and remove any resources they draw from. Return null if none can be found.


getCoherentResourceGroups

java.util.List getCoherentResourceGroups(java.lang.String coding,
                                         java.lang.String observation)
Return the full list of real resources, except that if there are virtual resources, add them to the list and remove any resources they draw from. Return null if none can be found.


deleteResource

void deleteResource(java.lang.String resourceid)
delete resource given its ID


addResource

void addResource(java.lang.String coding,
                 NResource resource)
add a new resource


getResourcePath

java.lang.String getResourcePath(java.lang.String resourceid)
find the path to the resource: each resource has one location on disk which can be affected by: the location of the resource file (if paths are relative); the 'path' attribute of the resource-type element in the resource file; the 'path' attribute of the 'resource' element


getResourcePath

java.lang.String getResourcePath(NResource resource)
find the path to the resource: each resource has one location on disk which can be affected by: the location of the resource file (if paths are relative); the 'path' attribute of the resource-type element in the resource file; the 'path' attribute of the 'resource' element


writeResourceFile

void writeResourceFile(java.lang.String filename)
save the resource file to a file with the given filename.


writeResourceFile

void writeResourceFile()
save the resource file to the current filename (by default the file it was created from, or set using setFilename).


setFilename

void setFilename(java.lang.String filename)
set the resource filename for any future save: relative paths are assumed to be relative to the metadata directory. NOTE: This does NOT update the resource file name saved in the metadata file: you shoud really use NMetaData.setResourceFilename.


getResourceFilePath

java.lang.String getResourceFilePath()
Return the path to the resource file (absolute)


getIncompatibleResources

java.util.List getIncompatibleResources(NResource res)
get a List of NResource elements that are incompatible with this one


getResourceGroupForCoding

NResourceGroup getResourceGroupForCoding(java.lang.String coding)
find a NResourceGroup elements that instantiate the named coding. If there are zero, return null.


addResourceGroup

void addResourceGroup(NResourceGroup nrg)
add a NResourceGroup element for resources that instantiate the named coding.