viper.descriptors
Interface DescriptorData

All Known Implementing Classes:
DescHolder

public interface DescriptorData

A set of descriptors that can be associated with multiple source media files.


Field Summary
static java.lang.String NAMESPACE_URI
          The URI used while parsing XML data.
 
Method Summary
 boolean addFileName(java.lang.String S)
          Adds a new URL/filename to the set that this object describes (Optional).
 DescriptorConfigs getDescriptorConfigs()
          Gets the DescriptorConfigs associated with this data.
 java.util.Iterator getFileNames()
          Returns the URL/filenames of all the media this DescriptorData describes.
 DescriptorList getFlattenedData()
          Returns the list as one long DescriptorList.
 DescriptorList getForFile(java.lang.String fileName)
          Return the DescriptorList who describe the media with the specified filename or URL String.
 java.lang.String getInformation()
          Returns a string for .raw output summarizing what media files this descriptor uses and so forth.
 Equivalencies getMap()
          Gets the Equivalency map for this list.
 org.w3c.dom.Element getXMLFormat(org.w3c.dom.Document root)
          Gets the data in ViPER XML format.
 boolean isMultifile()
          Determines if this describes more than one media file.
 void merge(DescriptorData other)
          Adds the data from the other DescriptorData to this one.
 void parseData(org.xml.sax.InputSource input, Equivalencies map, RuleHolder limits, DescriptorConfigs cfgs, java.io.PrintWriter logfile)
          Reads in Descriptor data from the specified XML input source.
 void parseData(java.util.List allFiles, DescriptorConfigs cfgs, RuleHolder limits, Equivalencies map)
          Reads in Descriptor data from the specified list of filenames with the specified config info.
 DescriptorList removeFile(java.lang.String filename)
          Removes the given file name and its corresponding metadata.
 void resetIds()
          Resets all object ids.
 DescriptorList setDataForFile(java.lang.String S, DescriptorList l)
          Replaces the DesciptorList associated to a given filename with the DescriptorList that is passed in.
 void setMap(Equivalencies map)
          Sets the equivalency map of the list.
 

Field Detail

NAMESPACE_URI

public static final java.lang.String NAMESPACE_URI
The URI used while parsing XML data.

See Also:
Constant Field Values
Method Detail

getMap

public Equivalencies getMap()
Gets the Equivalency map for this list.

Returns:
the Equivalency map for this list

setMap

public void setMap(Equivalencies map)
Sets the equivalency map of the list.

Parameters:
map - the new Equivalency map for this list

getForFile

public DescriptorList getForFile(java.lang.String fileName)
Return the DescriptorList who describe the media with the specified filename or URL String.

Parameters:
fileName - the file to get the metadata of
Returns:
the descriptors for the given file

getFileNames

public java.util.Iterator getFileNames()
Returns the URL/filenames of all the media this DescriptorData describes.

Returns:
the names of all the described files

removeFile

public DescriptorList removeFile(java.lang.String filename)
Removes the given file name and its corresponding metadata.

Parameters:
filename - the file to remove
Returns:
the metadata for the file

addFileName

public boolean addFileName(java.lang.String S)
                    throws java.lang.UnsupportedOperationException
Adds a new URL/filename to the set that this object describes (Optional).

Parameters:
S - the name of the file to add
Returns:
true, if it was added
Throws:
java.lang.UnsupportedOperationException

setDataForFile

public DescriptorList setDataForFile(java.lang.String S,
                                     DescriptorList l)
                              throws java.lang.UnsupportedOperationException
Replaces the DesciptorList associated to a given filename with the DescriptorList that is passed in. Should be implemented if addFileName() is implemented.

Parameters:
S - the name of the file to change
l - the new value
Returns:
the previous value
Throws:
java.lang.UnsupportedOperationException

parseData

public void parseData(java.util.List allFiles,
                      DescriptorConfigs cfgs,
                      RuleHolder limits,
                      Equivalencies map)
Reads in Descriptor data from the specified list of filenames with the specified config info.

Parameters:
allFiles - Vector of Strings containing the names of the files to search for config information
cfgs - the Descriptor configuration information
limits - A RuleHolder to determine which descriptors to read in
map - the equivalencies to use while parsing

parseData

public void parseData(org.xml.sax.InputSource input,
                      Equivalencies map,
                      RuleHolder limits,
                      DescriptorConfigs cfgs,
                      java.io.PrintWriter logfile)
               throws java.io.IOException,
                      BadDataException
Reads in Descriptor data from the specified XML input source.

Parameters:
input - the XML input source
map - the attribute/descriptor equivalencies
limits - A RuleHolder to determine which descriptors to read in
cfgs - if this is null, the parser is looks for the <config> element and generates its own config information. If you want to do things like limitation parsing and evaluations, you will have to parse the config info first.
logfile - where error and notifications are written
Throws:
java.io.IOException
BadDataException

getInformation

public java.lang.String getInformation()
Returns a string for .raw output summarizing what media files this descriptor uses and so forth. The data is formatted as
 
 Directory Sequence mapping (list of frame / filename pairs) SEQUENCE |
 FRAMES Number of Frames
 
 

Returns:
the file information in raw format

isMultifile

public boolean isMultifile()
Determines if this describes more than one media file.

Returns:
true if this describes more than one media file

getFlattenedData

public DescriptorList getFlattenedData()
Returns the list as one long DescriptorList.

Returns:
the list as one long DescriptorList, with the frame spans shifted so the media files are serialized

getDescriptorConfigs

public DescriptorConfigs getDescriptorConfigs()
Gets the DescriptorConfigs associated with this data.

Returns:
the DescriptorConfigs associated with this data

merge

public void merge(DescriptorData other)
Adds the data from the other DescriptorData to this one.

Parameters:
other - the data to merge from

getXMLFormat

public org.w3c.dom.Element getXMLFormat(org.w3c.dom.Document root)
Gets the data in ViPER XML format. Probably should be moved into own class...

Parameters:
root - the document to use while creating the element
Returns:
the viper root element

resetIds

public void resetIds()
Resets all object ids. Useful for mixing and matching descriptors from different sources.