|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object viper.descriptors.Descriptor viper.descriptors.DescPrototype
The DescPrototype is a descriptor object that does not contain data and supports
Field Summary |
Fields inherited from class viper.descriptors.Descriptor |
attributes, composable, croppingType, span |
Constructor Summary | |
DescPrototype(java.lang.String category,
java.lang.String name)
Constructs a new descriptor definition. |
Method Summary | |
void |
addAttribute(AttributePrototype ap)
Adds the given attribute type. |
void |
addAttribute(java.lang.String name,
java.lang.String type)
Adds a new attribute with the given type information. |
void |
addAttribute(java.lang.String name,
java.lang.String type,
java.lang.String extra)
Adds the given attribute with the specified parameters. |
java.lang.Object |
clone()
Generates a new Descriptor Object sharing none of the references of the original but containing identical data. |
Descriptor |
compose(Descriptor D,
EvaluationParameters.ScopeRules scope)
Cannot compose prototypes |
Descriptor |
create()
Creates a new, empty descriptor from this type information. |
Descriptor |
crop(FrameSpan span)
Does nothing. |
java.util.Set |
getAttribNames()
Gets the names of all attributes instances of this descriptor type may have. |
AttributePrototype |
getAttributePrototype(java.lang.String name)
Gets that specification for the attribute with the given name. |
Filterable |
getFilterable(java.lang.String attribName)
Returns the specified Attribute or FrameSpan. |
FrameSpan |
getFrameSpan()
Gets the frames where the descriptor exists. |
java.lang.Object |
getID()
Returns the ID number of the descriptor. |
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. |
void |
moveFrame(int offset)
Shifts the descriptor by the given offset. |
int |
numIDs()
Returns the number of Identification numbers in this descriptor. |
Descriptor |
parseDescriptorData(org.w3c.dom.Element myElement,
DescVector relativeVector)
Reads in the data in xml format. |
Descriptor |
parseDescriptorData(VReader reader,
DescVector relativeVector)
Reads in Descriptor data filtered through this Descriptor's config information. |
void |
setFrameSpan(FrameSpan span)
Prototypes are not instantiated, so do not have frame spans; this method throws an exception. |
void |
setID(int id)
|
java.lang.String |
toString()
Gives the prototype in gtf format. |
Methods inherited from class viper.descriptors.Descriptor |
compareTo, composeThese, endFrame, equals, getAttribute, getAttribute, getAttributeIndex, getAttributeIndex, getAttributeNames, getAttributesOfType, getCategory, getFullName, getHighestFrame, getName, getType, hasAttribute, hashCode, isCategory, isComposable, isRoc, named, parseDescriptorConfig, parseDescriptorConfig, printSelf, printSelf, rawFormat, rocAttributeName, sameCategoryAs, setCategory, setName, startFrame, startsWithCategory |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public DescPrototype(java.lang.String category, java.lang.String name) throws BadDataException
category
- the category, e.g. "CONTENT" or "OBJECT"name
- the name of the descriptor, e.g. "Person"
BadDataException
- if the content is unknown or if the name is badMethod Detail |
public java.util.Set getAttribNames()
public AttributePrototype getAttributePrototype(java.lang.String name)
name
- the name of that attribute to look up
public boolean hasAttrib(java.lang.String attribName)
Descriptor
hasAttrib
in class Descriptor
attribName
- the attribute to check for
public void addAttribute(java.lang.String name, java.lang.String type) throws BadDataException
name
- the name of the new attributetype
- the data type of the new attribute, e.g. viper:bbox.
BadDataException
public Filterable getFilterable(java.lang.String attribName)
Descriptor
getFilterable
in class Descriptor
attribName
- -
the name of the Attribute to get
public void addAttribute(java.lang.String name, java.lang.String type, java.lang.String extra) throws BadDataException
name
- the name of the new attributetype
- the type information for the attributeextra
- extra information, such as the elements of an lvalue list
BadDataException
- if there is an error in the type or the extras config
informationpublic void addAttribute(AttributePrototype ap)
ap
- the attribute type and name informationpublic java.lang.String toString()
toString
in class Descriptor
public org.w3c.dom.Element getXMLFormat(org.w3c.dom.Document root)
Descriptor
getXMLFormat
in class Descriptor
root
- The DOM Document to attach the element to.
public Descriptor create()
public java.lang.Object getID()
getID
in class Descriptor
public void setID(int id)
public int numIDs()
Descriptor
numIDs
in class Descriptor
public FrameSpan getFrameSpan()
Descriptor
getFrameSpan
in class Descriptor
null
public void setFrameSpan(FrameSpan span)
setFrameSpan
in class Descriptor
span
- the new span
java.lang.UnsupportedOperationException
- This method isn't implemented, as it doesn't really apply to
prototypes.public Descriptor compose(Descriptor D, EvaluationParameters.ScopeRules scope) throws java.lang.UnsupportedOperationException
compose
in class Descriptor
D
- the descriptor to compose withscope
- the scoping rules
java.lang.UnsupportedOperationException
- This method isn't implemented, as it doesn't really apply to
prototypes.DescAggregate
public java.lang.Object clone()
Descriptor
clone
in class Descriptor
public Descriptor parseDescriptorData(VReader reader, DescVector relativeVector) throws java.lang.CloneNotSupportedException, BadDataException
reader
- the reader from which to retrieve the next Descriptor datarelativeVector
- the configuration/rules to use are here
java.lang.CloneNotSupportedException
BadDataException
public Descriptor parseDescriptorData(org.w3c.dom.Element myElement, DescVector relativeVector) throws BadDataException
myElement
- the xml element to parserelativeVector
- the parsed data, so far
BadDataException
- if there is an error in the filepublic Descriptor crop(FrameSpan span)
crop
in class Descriptor
span
- the new span
public void moveFrame(int offset)
Descriptor
moveFrame
in class Descriptor
offset
- the number of frames to shift
the descriptor.
java.lang.UnsupportedOperationException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |