|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object viper.descriptors.Descriptor
This class represents a Descriptor of a given visual element in a video file. There are three types: FILE, CONTENT, and OBJECT.
Field Summary | |
protected Attribute[] |
attributes
The attributes. |
protected boolean |
composable
|
protected java.lang.String |
croppingType
|
protected FrameSpan |
span
|
Constructor Summary | |
protected |
Descriptor()
Constructs a new, empty descriptor. |
|
Descriptor(java.lang.String designation)
This constructor takes in the type of Descriptor to create. |
Method Summary | |
abstract java.lang.Object |
clone()
Generates a new Descriptor Object sharing none of the references of the original but containing identical data. |
int |
compareTo(java.lang.Object o)
This compares the Category and Name fields. |
abstract Descriptor |
compose(Descriptor D,
EvaluationParameters.ScopeRules scope)
Composes this descriptor with the given descriptor under the given set of scope and composition rules. |
static Descriptor |
composeThese(java.util.Iterator L,
EvaluationParameters.ScopeRules scope)
Turns a list of Descriptors into a single Descriptor in order. |
abstract Descriptor |
crop(FrameSpan span)
Like clone, but only clones a subset of this descriptor. |
int |
endFrame()
Gets the last valid frame. |
boolean |
equals(java.lang.Object o)
|
Attribute |
getAttribute(java.lang.String attribName)
Returns the specified Attribute. |
Attribute |
getAttribute(java.lang.String attribName,
Equivalencies map)
Gets the attribute with the given name. |
int |
getAttributeIndex(java.lang.String name)
Function returns the index of the named attribute or -1 if not found. |
int |
getAttributeIndex(java.lang.String name,
Equivalencies map)
Gets the index of the attribute with the given name, under the given ontology mapping. |
java.lang.String[] |
getAttributeNames()
Get all attribute names. |
Attribute[] |
getAttributesOfType(java.lang.String type,
boolean getDerived)
Returns the specified Attribute. |
java.lang.String |
getCategory()
Returns the category of this Descriptor. |
Filterable |
getFilterable(java.lang.String attribName)
Returns the specified Attribute or FrameSpan. |
abstract FrameSpan |
getFrameSpan()
Gets the frames where the descriptor exists. |
java.lang.String |
getFullName()
Gets the full name of the descriptor, including category, e.g. |
int |
getHighestFrame()
Returns the number of the highest frame among this Descriptor |
abstract java.lang.Object |
getID()
|
java.lang.String |
getName()
Gets the name of the Descriptor. |
java.lang.String |
getType()
Gets the type of the descriptor, ie OBJECT or CONTENT. |
abstract org.w3c.dom.Element |
getXMLFormat(org.w3c.dom.Document root)
Gets an XML representation of the descriptor. |
boolean |
hasAttrib(java.lang.String attribName)
Checks to see if this Descriptor has an attribute with the specifified name. |
boolean |
hasAttribute(java.lang.String S)
Checks to see if this String could be a value for any of the Attributes. |
int |
hashCode()
|
static boolean |
isCategory(java.lang.String test)
Tests to see if the String is a Descriptor category. |
boolean |
isComposable()
Tests to see if it is possible to aggregate this descriptor with others of the same type. |
boolean |
isRoc()
Function resturns true if one of the attributes was ROC. |
abstract void |
moveFrame(int offset)
Shifts the descriptor by the given offset. |
boolean |
named(java.lang.String S)
Tests to see if the Descriptor is named S |
abstract int |
numIDs()
Returns the number of Identification numbers in this descriptor. |
static DescPrototype |
parseDescriptorConfig(org.w3c.dom.Element desc)
parses the given descriptor config |
static DescPrototype |
parseDescriptorConfig(VReader reader)
Reads in a piece of Descriptor configuration data from a VReader. |
void |
printSelf(java.io.PrintWriter output)
Prints this descriptor in .gtf format to the given output writer. |
void |
printSelf(java.io.PrintWriter output,
java.lang.String padding)
Prints this descriptor in .gtf format to the given output writer. |
java.lang.String |
rawFormat()
Function returns the raw string representation of this object. |
java.lang.String |
rocAttributeName()
Function returns the name of the roc attribute or "" if not found |
boolean |
sameCategoryAs(Descriptor other,
Equivalencies map)
Tests to see if the descriptors refer to the same type under the given ontology mapping. |
void |
setCategory(java.lang.String s)
Sets the descriptor type, e.g. |
abstract void |
setFrameSpan(FrameSpan span)
Replaces the frame span. |
void |
setName(java.lang.String n)
Sets the Descriptor's name. |
int |
startFrame()
Gets the first frame of the frame span |
static boolean |
startsWithCategory(java.lang.String test)
Tests to see if a String starts with a proper Descriptor category |
java.lang.String |
toString()
Returns a String representation of the Descriptor. |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
protected Attribute[] attributes
protected java.lang.String croppingType
protected FrameSpan span
protected boolean composable
Constructor Detail |
public Descriptor(java.lang.String designation) throws BadDataException
designation
- the type of Descriptor. Either FILE, CONTENT, or OBJECT
BadDataException
- -
if the specified category is not one of the three
allowableprotected Descriptor()
Method Detail |
public void setCategory(java.lang.String s) throws java.lang.IllegalArgumentException
s
- the new category
java.lang.IllegalArgumentException
- if the category isn't validpublic boolean isRoc()
public java.lang.String rocAttributeName()
public int getAttributeIndex(java.lang.String name)
name
- the name to look for
public int getAttributeIndex(java.lang.String name, Equivalencies map)
name
- the attribute to look formap
- the mapping to use. It will also check the original
name.
public static boolean isCategory(java.lang.String test)
test
- -
the string to be tested
public static boolean startsWithCategory(java.lang.String test)
test
- String to be tested; usually a line of text
public abstract java.lang.Object clone()
public int compareTo(java.lang.Object o)
o
- the Descriptor to compare this with
java.lang.ClassCastException
public boolean sameCategoryAs(Descriptor other, Equivalencies map)
other
- the descriptor to compare withmap
- the type map
public boolean hasAttrib(java.lang.String attribName)
attribName
- the attribute to check for
public abstract java.lang.Object getID()
public abstract int numIDs()
public abstract FrameSpan getFrameSpan()
public abstract void moveFrame(int offset)
offset
- the number of frames to shift
the descriptor.public abstract void setFrameSpan(FrameSpan span)
span
- the new spanpublic abstract Descriptor crop(FrameSpan span)
span
- the new span
public Attribute getAttribute(java.lang.String attribName)
attribName
- -
the name of the Attribute to get
public Attribute getAttribute(java.lang.String attribName, Equivalencies map)
attribName
- the attribute namemap
- the ontology map
null
if not foundpublic Attribute[] getAttributesOfType(java.lang.String type, boolean getDerived) throws java.lang.ClassNotFoundException
type
- the type of Attribute to getgetDerived
- true indicates all types derived from the base type
java.lang.ClassNotFoundException
- if type is invalidpublic Filterable getFilterable(java.lang.String attribName)
attribName
- -
the name of the Attribute to get
public java.lang.String toString()
public java.lang.String getFullName()
public static DescPrototype parseDescriptorConfig(org.w3c.dom.Element desc) throws BadDataException
desc
- the config element to parse
BadDataException
- if there is an error in the xmlpublic static DescPrototype parseDescriptorConfig(VReader reader)
reader
- -
the reader to get information from
public void setName(java.lang.String n)
n
- -
the new name of this Descriptorpublic boolean named(java.lang.String S)
S
- -
the name to test
public java.lang.String getName()
public java.lang.String getType()
public java.lang.String getCategory()
public void printSelf(java.io.PrintWriter output, java.lang.String padding)
output
- the stream to usepadding
- the amount of padding to put to the left.
Useful for indenting descriptors.public void printSelf(java.io.PrintWriter output)
output
- the stream to usepublic int getHighestFrame()
public boolean hasAttribute(java.lang.String S)
S
- the String to check
public int startFrame()
public int endFrame()
public java.lang.String rawFormat()
public static Descriptor composeThese(java.util.Iterator L, EvaluationParameters.ScopeRules scope) throws BadDataException, UncomposableException
L
- the descriptors to composescope
- the scoping rules to use
BadDataException
UncomposableException
public boolean isComposable()
true
if the descriptor
is amenable to aggregationcompose(Descriptor, EvaluationParameters.ScopeRules)
,
DescAggregate
public abstract Descriptor compose(Descriptor D, EvaluationParameters.ScopeRules scope) throws java.lang.UnsupportedOperationException, BadDataException, UncomposableException
D
- the descriptor to compose withscope
- rules for the composition
java.lang.UnsupportedOperationException
BadDataException
UncomposableException
DescAggregate
public java.lang.String[] getAttributeNames()
public abstract org.w3c.dom.Element getXMLFormat(org.w3c.dom.Document root)
root
- The DOM Document to attach the element to.
public boolean equals(java.lang.Object o)
public int hashCode()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |