|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.annotation.util.FeatureMap org.annotation.wordfreak.Relation
Class for storing a relation between annotations. The relation is represented as a frame consisting a series of frame elements, a type, and an anchor annotation. Each element is named with its role, and multiple elements can share the same role name. Elements can be uniquely identified via their index in the frame.
Field Summary | |
static int |
ARGUMENT_SPAN
|
static int |
NONE
|
static int |
ROLE_NAME
|
static java.lang.String |
TYPE
|
Fields inherited from class org.annotation.util.FeatureMap |
DEFAULT_SET_DELIMITER, properties |
Constructor Summary | |
Relation(java.lang.String t,
java.lang.String[] roles,
Annotation[] annotations)
Creates a new relation witht the specified type and populates the frame with the specified role names mapping them to their coresponding specified annotations. |
Method Summary | |
java.util.Iterator |
annotationsIterator()
|
void |
clear()
|
boolean |
contains(Annotation a)
|
boolean |
contains(java.lang.String r)
|
Annotation[] |
get(java.lang.String role)
Returns each annotation in this relation whose role name matches the specified role name. |
Annotation |
getAnchor()
|
Annotation |
getAnnotation(int position)
|
Argument |
getArgument(Annotation a)
|
Argument |
getArgument(int position)
|
java.lang.String |
getRole(Annotation argument)
Returns the role name for the specified position in the relation's frame. |
java.lang.String |
getRole(int position)
Returns the role name for the specified position in the relation's frame. |
java.lang.String |
getType()
|
int |
indexOf(Annotation ann)
Returns the index of the first occurance of the specified annotation |
int |
indexOf(java.lang.String role)
Returns the index of the first occurance of the specified role name. |
Annotation |
put(int position,
Annotation a)
Puts the specified annotation at the specified position in the frame and returns the annotation which previously held that position. |
void |
put(java.lang.String role,
Annotation a)
Adds the specified role to the relation frame and associates it with the specified annotation. |
Annotation |
remove(Annotation annotation)
Removes the specified annotation from this relation. |
Annotation |
removeRole(java.lang.String role)
Removes each instance of the specified role name. |
void |
renameRole(java.lang.String oldr,
java.lang.String newr)
Renames the each instance of the specified old role name to the new role name. |
java.util.Iterator |
rolesIterator()
|
void |
setAnchor(Annotation a)
|
void |
setAnchor(java.lang.String r)
|
void |
setFeature(java.lang.String k,
java.lang.String v)
|
void |
setType(java.lang.String t)
|
int |
size()
Returns the number of frame elements in this relation. |
void |
sortBy(int s)
|
java.lang.String |
toString()
|
Methods inherited from class org.annotation.util.FeatureMap |
addFeatureValue, addFeatureValue, existsFeature, getFeature, getFeatureAsSet, getFeatureAsSet, getFeatureSet, removeFeature, removeFeatureValue, removeFeatureValue, setFeatures, setProperties |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static int NONE
public static int ROLE_NAME
public static int ARGUMENT_SPAN
public static java.lang.String TYPE
Constructor Detail |
public Relation(java.lang.String t, java.lang.String[] roles, Annotation[] annotations)
t
- The type of the relation.roles
- The role names for each of the frame elements.annotations
- The annotations associated with the specified role names.Method Detail |
public void sortBy(int s)
public void setType(java.lang.String t)
public java.lang.String getType()
public int size()
getAnnotation
to iterate through the frames of a relation.
public int indexOf(java.lang.String role)
role
- The role name being searched for.
public int indexOf(Annotation ann)
ann
- The annotation being searched for.
public void put(java.lang.String role, Annotation a)
role
- The role name for the new frame element.a
- The annotation associated with the new frame element.public Annotation put(int position, Annotation a)
position
- The position in the frame where the annotation will be placed.a
- The annotation to be placed at the specified position.
java.lang.IndexOutOfBoundsException
- if the index is out of range.public java.lang.String getRole(int position)
position
- The position in the frame.
public java.lang.String getRole(Annotation argument)
argument
- The argument in the frame.
public Annotation getAnnotation(int position)
public Argument getArgument(int position)
public Argument getArgument(Annotation a)
public Annotation[] get(java.lang.String role)
role
- The role name to be search for.
public boolean contains(Annotation a)
public boolean contains(java.lang.String r)
public void renameRole(java.lang.String oldr, java.lang.String newr)
oldr
- The old role name.newr
- The new role name.public Annotation removeRole(java.lang.String role)
role
- The role name to remove.
public Annotation remove(Annotation annotation)
annotation
- The annotation to be removed.
public void setAnchor(java.lang.String r)
public void setAnchor(Annotation a)
public Annotation getAnchor()
public void setFeature(java.lang.String k, java.lang.String v)
setFeature
in class FeatureMap
public void clear()
public java.util.Iterator rolesIterator()
public java.util.Iterator annotationsIterator()
public java.lang.String toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |