|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--anvil.annot.AnnotationElement
The smallest annotation unit, containing a number of attribute-value pairs.
Field Summary | |
protected java.util.Hashtable |
avField
|
protected java.lang.String |
comment
Contains arbitrary comment |
protected AnnotationContainer |
container
Container where this element is contained in. |
protected int |
index
index only used for saving (Anvil format) |
Constructor Summary | |
AnnotationElement(AnnotationContainer c)
|
Method Summary | |
void |
addAttributeLinkValue(java.lang.String attribute,
java.lang.Object val)
Adds value to attribute value list. |
boolean |
addAttributeLinkValueOnce(java.lang.String attribute,
java.lang.Object val)
Adds value to attribute value list. |
protected void |
addDependent(AnnotationElement el)
|
protected java.lang.String |
ascii2xml(java.lang.String s)
|
void |
clearAttribute(java.lang.String attribute)
Clears value of the attribute. |
void |
clearExtraObjects()
|
void |
clearInlinks()
|
java.util.List |
findAllDependents()
Recursively finds all elements that point to this one (dependents) and all dependents' dependents etc. |
protected int |
findElementInLinks(AnnotationElement el)
Returns the number of pointers in attributes of this element. |
java.lang.String |
getAttribute(java.lang.String attName)
Returns a String representation of the attribute's value. |
boolean |
getBoolValue(java.lang.String attrName)
Returns the attribute's value interpreted as a boolean, i.e. returns true iff value is "true", false otherwise. |
java.util.List |
getClonedDependents()
Returns clone of the list. |
java.lang.String |
getComment()
Returns the free-form research note/comment to this element. |
AnnotationContainer |
getContainer()
Returns the container that contains this element. |
java.util.List |
getDependents()
Returns list of all elements in the dependent track (secondary track) that point to this one (by anchor). |
AnvilExtraObject |
getExtraObject(java.lang.String key)
|
java.util.List |
getInlinks()
Returns list of track elements that point to this one (by attribute). |
java.util.Set |
getInlinkTracks()
Returns set of tracks that contain elements pointing to this one. |
java.util.List |
getLinkedElements()
|
java.util.List |
getLinkNames()
Returns sorted order of attributes of link type. |
java.util.List |
getListValue(java.lang.String attrName)
If the attribute is a link, a list is returned (possibly empty). |
java.lang.Integer |
getNumberValue(java.lang.String attrName)
Returns the attribute's value interpreted as an integer |
java.util.List |
getOutlinks()
Returns all track elements that this element is pointing to (by attribute). |
java.lang.String |
getShowLabel()
Returns what should be displayed on the annotation board. |
boolean |
hasComment()
Returns true if this element contains a comment, false otherwise. |
boolean |
isAttribute(java.lang.String att)
Checks whether att is a valid attribute. |
boolean |
meetsConstraints(java.util.List goods,
java.util.List nogoods)
Returns true if this element has all the AV-pairs specified in goods and has none of the AV-pairs specified in
nogoods (empty goods/nogoods list means "no
constraint"). |
boolean |
putAttribute(java.lang.String attName,
java.lang.Object attValue)
Inserts AV pair into attribute field. |
void |
putExtraObject(java.lang.String key,
AnvilExtraObject obj)
|
protected boolean |
removeDependent(AnnotationElement el)
|
protected int |
removeElementFromLinks(AnnotationElement el)
Removes track element el from all link attributes
containing it. |
int |
removeMeFromInlinks()
Removes this element from the inlink lists of all outlinked elements. |
void |
setComment(java.lang.String comment)
Sets the free-form research note/comment to this element. |
protected void |
setDependents(java.util.List deps)
|
void |
setInlinks(java.util.List links)
|
java.lang.String |
toString()
|
protected void |
writeAnvilFile(kipp.io.MyBufferedWriter f)
Writes the |
protected void |
writeContents(kipp.io.MyBufferedWriter f)
Called by specialized writeAnvilFile methods to write attributes and comment in XML file. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected java.util.Hashtable avField
protected java.lang.String comment
protected AnnotationContainer container
protected int index
Constructor Detail |
public AnnotationElement(AnnotationContainer c)
Method Detail |
public void putExtraObject(java.lang.String key, AnvilExtraObject obj)
public AnvilExtraObject getExtraObject(java.lang.String key)
public void clearExtraObjects()
public boolean isAttribute(java.lang.String att)
att
is a valid attribute.
att
- attribute's namepublic AnnotationContainer getContainer()
public java.lang.String getComment()
public void setComment(java.lang.String comment)
public java.lang.String toString()
toString
in class java.lang.Object
public java.util.List getOutlinks()
public java.util.List getInlinks()
public java.util.Set getInlinkTracks()
public void clearInlinks()
public void setInlinks(java.util.List links)
protected void addDependent(AnnotationElement el)
protected void setDependents(java.util.List deps)
protected boolean removeDependent(AnnotationElement el)
public java.util.List getDependents()
public java.util.List findAllDependents()
public java.util.List getClonedDependents()
public void addAttributeLinkValue(java.lang.String attribute, java.lang.Object val)
public boolean addAttributeLinkValueOnce(java.lang.String attribute, java.lang.Object val)
public int removeMeFromInlinks()
protected int removeElementFromLinks(AnnotationElement el)
el
from all link attributes
containing it.
protected int findElementInLinks(AnnotationElement el)
public void clearAttribute(java.lang.String attribute)
public boolean putAttribute(java.lang.String attName, java.lang.Object attValue)
public java.lang.String getAttribute(java.lang.String attName)
attName
- Name of desired attribute.
public boolean getBoolValue(java.lang.String attrName)
attrName
- Name of desired attribute.public java.lang.Integer getNumberValue(java.lang.String attrName)
attrName
- Name of desired attribute.public java.util.List getListValue(java.lang.String attrName)
public boolean meetsConstraints(java.util.List goods, java.util.List nogoods)
goods
and has none of the AV-pairs specified in
nogoods
(empty goods/nogoods list means "no
constraint").
public java.util.List getLinkNames()
public java.util.List getLinkedElements()
public java.lang.String getShowLabel()
public boolean hasComment()
protected java.lang.String ascii2xml(java.lang.String s)
protected void writeAnvilFile(kipp.io.MyBufferedWriter f) throws java.io.IOException
java.io.IOException
protected void writeContents(kipp.io.MyBufferedWriter f) throws java.io.IOException
java.io.IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |