|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.AbstractCollection java.util.AbstractList java.util.Vector viper.descriptors.DescVector
A collection of Descriptor Objects that supports various operations on them, such as comparison between to DescVector, collection of statistics, reading and printing from files, and various others. It extends Vector now, but could be made to extend some sorted list object without too much hassle.
Field Summary |
Fields inherited from class java.util.Vector |
capacityIncrement, elementCount, elementData |
Fields inherited from class java.util.AbstractList |
modCount |
Constructor Summary | |
DescVector(DescriptorData parent)
Constructs an empty list of descriptors with the given parent data holder. |
|
DescVector(int initialCapacity,
DescriptorData parent)
Constructs an empty list of descriptors with the given parent data holder. |
Method Summary | |
void |
addDescriptor(Descriptor desc)
Adds a new descriptor to this set. |
java.util.Iterator |
cropNodesToSpan(FrameSpan span)
Like getNodesByFrame, but instead, the Iterator returns copies of the Descriptor objects contained here, each cropped to contain no frames beyond the specified FrameSpan. |
java.util.Collection |
getAllDescriptors()
Get a collection of all of the descriptors declared for this source file. |
CanonicalFileDescriptor |
getFileInformation()
Gets file information. |
int |
getHighestFrame()
Returns the greatest frame index of all Descriptor objects. |
java.util.List |
getIds()
Gets a flattened list of all ids. |
java.lang.String |
getInformation()
Gets the source media file information. |
int |
getLowestFrame()
Returns the least frame index of all Descriptor objects. |
Equivalencies |
getMap()
Gets the map of the parent DescriptorData that holds the information for this sourcefile. |
Descriptor |
getNodeByID(java.lang.String type,
java.lang.String name,
int idNumber)
Returns the Descriptor with the given id number and type. |
java.util.Iterator |
getNodesByFrame(FrameSpan span)
Returns descriptors that contain the subspan, or some of the subspan, with their framespan set to the subspan intersected with the span. |
java.util.Iterator |
getNodesByID(int idNumber)
Returns all Descriptors with the given id number. |
java.util.Iterator |
getNodesByType(java.lang.String type,
java.lang.String name)
Returns the first Descriptor in the list with the specified category and title. |
java.util.Iterator |
getNodesByType(java.lang.String type,
java.lang.String name,
Equivalencies map)
Returns the first Descriptor in the list with the specified category and title. |
DescriptorData |
getParent()
Gets the parent set of descriptor lists. |
java.lang.String |
getSourcefileName()
Gets the name of the file this metadata describes. |
org.w3c.dom.Element |
getXMLFormat(org.w3c.dom.Document root)
Returns a sourcefile tag with lots of children. |
boolean |
hasDescriptor(java.lang.String type,
java.lang.String name)
Checks to see if a Descriptor with this category and title is in the list. |
void |
parseData(org.w3c.dom.Element source,
RuleHolder limits)
Reads in the given data in xml format. |
void |
parseData(java.util.List allFiles,
RuleHolder limits)
Reads in Descriptor data from the specified list of files with the specified config info. |
void |
parseData(java.util.List allFiles,
RuleHolder limits,
boolean all,
boolean err,
boolean warn,
boolean bad,
boolean totals)
Reads in Descriptor data from the specified list of files with the specified config info. |
protected void |
parseData(VReader reader,
RuleHolder limits)
|
void |
printOut(java.io.PrintWriter output)
Prints the data out to a file in the specified format. |
void |
setFileInformation(CanonicalFileDescriptor cfd)
Will try to set the canonical file descriptor. |
void |
setMap(Equivalencies map)
Sets the map of the parent DescriptorData that holds the information for this sourcefile. |
void |
setSourcefileName(java.lang.String S)
Sets the source file name. |
java.lang.String |
toString()
Prints the data in .gtf format, header and footer included. |
Methods inherited from class java.util.Vector |
add, add, addAll, addAll, addElement, capacity, clear, clone, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, get, hashCode, indexOf, indexOf, insertElementAt, isEmpty, lastElement, lastIndexOf, lastIndexOf, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, removeRange, retainAll, set, setElementAt, setSize, size, subList, toArray, toArray, trimToSize |
Methods inherited from class java.util.AbstractList |
iterator, listIterator, listIterator |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface viper.descriptors.DescriptorList |
clone, get, size |
Methods inherited from interface java.util.Collection |
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, toArray, toArray |
Methods inherited from interface java.util.List |
iterator, listIterator, listIterator |
Constructor Detail |
public DescVector(DescriptorData parent)
parent
- the data holder that will contain this.
You will have to add this to the holder manually.public DescVector(int initialCapacity, DescriptorData parent)
parent
- the data holder that will contain this.
You will have to add this to the holder manually.initialCapacity
- the initial vector capacityMethod Detail |
public java.lang.String getSourcefileName()
public void setSourcefileName(java.lang.String S)
S
- the name of the file this set of metadata describespublic java.util.Collection getAllDescriptors()
DescriptorList
getAllDescriptors
in interface DescriptorList
Collection
of Descriptor
spublic Equivalencies getMap()
getMap
in interface DescriptorList
DescriptorList.getMap()
public void setMap(Equivalencies map)
setMap
in interface DescriptorList
map
- the new equivalency map of the list.DescriptorList.setMap(Equivalencies)
public void parseData(java.util.List allFiles, RuleHolder limits)
allFiles
- a Vector of Strings containing the names of the files to
search for config informationlimits
- a set of rules that are checked. Descriptors that don't pass
the limits are not parsed.public void parseData(java.util.List allFiles, RuleHolder limits, boolean all, boolean err, boolean warn, boolean bad, boolean totals)
allFiles
- a Vector of Strings containing the names of the files to
search for config informationlimits
- a set of rules that are checked. Descriptors that don't pass
the limits are not parsed.all
- print out all data-containing lines of the parsed fileerr
- print out all error messageswarn
- print out all warning messagesbad
- print out the bad line in addition to the message and line
numbertotals
- print out total number of errors/warnings/etc.protected void parseData(VReader reader, RuleHolder limits)
reader
- uses the VReader at its current place. Note that this method
closes the reader at the end.limits
- only parse in descriptors that meet these rules. If
null
, then no rules are applied.public void parseData(org.w3c.dom.Element source, RuleHolder limits)
source
- the source DOM nodelimits
- information about what not to readpublic boolean hasDescriptor(java.lang.String type, java.lang.String name)
hasDescriptor
in interface DescriptorList
type
- the category of the Descriptorname
- the name of the Descriptor
public java.util.Iterator getNodesByType(java.lang.String type, java.lang.String name)
getNodesByType
in interface DescriptorList
type
- the category of the Descriptorname
- the name of the Descriptor
DescriptorList.getNodesByType(String, String)
public java.util.Iterator getNodesByType(java.lang.String type, java.lang.String name, Equivalencies map)
type
- the category of the Descriptorname
- the name of the Descriptormap
- Equivalencies to use while searching
public Descriptor getNodeByID(java.lang.String type, java.lang.String name, int idNumber)
DescriptorList
getNodeByID
in interface DescriptorList
type
- the type of the descriptorname
- the name of the descriptoridNumber
- the id number of the descriptor
null
.public java.util.List getIds()
getIds
in interface DescriptorList
public java.util.Iterator cropNodesToSpan(FrameSpan span)
DescriptorList
cropNodesToSpan
in interface DescriptorList
span
- the span to get values cropped to
public java.util.Iterator getNodesByFrame(FrameSpan span)
DescriptorList
getNodesByFrame
in interface DescriptorList
span
- the span to check
public java.util.Iterator getNodesByID(int idNumber)
DescriptorList
getNodesByID
in interface DescriptorList
idNumber
- the number to look for
public int getHighestFrame()
getHighestFrame
in interface DescriptorList
public int getLowestFrame()
getLowestFrame
in interface DescriptorList
public void printOut(java.io.PrintWriter output)
output
- -
the PrintWriter to hand the datapublic java.lang.String toString()
public java.lang.String getInformation()
public org.w3c.dom.Element getXMLFormat(org.w3c.dom.Document root)
getXMLFormat
in interface DescriptorList
root
- The DOM root
public void addDescriptor(Descriptor desc) throws java.lang.UnsupportedOperationException
DescriptorList
addDescriptor
in interface DescriptorList
desc
- the descriptor to add
java.lang.UnsupportedOperationException
public CanonicalFileDescriptor getFileInformation()
getFileInformation
in interface DescriptorList
DescriptorList.getFileInformation()
public void setFileInformation(CanonicalFileDescriptor cfd)
setFileInformation
in interface DescriptorList
cfd
- the new canonical file descriptorDescriptorList.setFileInformation(CanonicalFileDescriptor)
public DescriptorData getParent()
DescriptorList
getParent
in interface DescriptorList
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |