|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.ctakes.utils.xcas_comparison.XcasAnnotation
public class XcasAnnotation
An XcasAnnotation
object represents an element under the CAS
tag in an XCAS file. It provides members and methods to store and access
its type, attributes,and references.
Note: this class has a natural ordering that is inconsistent with equals.
It is strongly recommended that the use of compareTo(XcasAnnotation)
be strictly limited to the purpose of an orderly display of multiple objects.
Field Summary | |
---|---|
protected java.util.Hashtable<java.lang.String,java.lang.String> |
attributes
|
protected java.util.Hashtable<java.lang.String,org.apache.ctakes.utils.xcas_comparison.XcasAnnotation.MyVector> |
references
|
protected java.util.Hashtable<java.lang.String,java.util.Vector<java.lang.Integer>> |
refIntArrays
|
protected java.lang.String |
type
|
Constructor Summary | |
---|---|
XcasAnnotation()
Default constructor. |
|
XcasAnnotation(java.lang.String t)
Constructs an object with the specified type. |
Method Summary | |
---|---|
java.lang.String |
allFieldsValues()
Returns a string representation of all the attributes and references. |
java.lang.Object |
clone()
Recursive, deep copy of this object, including attributes and references. |
int |
compareTo(XcasAnnotation o)
Determines the order of this and the specified XcasAnnotation . |
java.lang.String |
description()
Returns a String representation of this object, including its type, and all attributes and references. |
boolean |
equals(java.lang.Object obj)
Determines whether the specified object equals to this one. |
java.lang.String |
getAttribute(java.lang.String name)
Returns the value of the specified attribute. |
java.util.Vector<XcasAnnotation> |
getReference(java.lang.String name)
Returns the referenced XcasAnnotation s of the specified attribute. |
java.lang.String |
getType()
|
void |
insertAttribute(java.lang.String k,
java.lang.String v)
Inserts an (attribute, value) pair to this XcasAnnotation . |
void |
insertIntReference(java.lang.String k,
int[] a)
|
void |
insertReference(java.lang.String k,
XcasAnnotation a)
|
void |
setType(java.lang.String t)
Sets the type name of this annotation. |
XcasAnnotation |
shallowCopy()
Clones this object, its attributes, and reference keys. |
java.lang.String |
shortType()
Returns a short description of this XcasAnnotation 's type,
specifically, the last segment as separated by dots. |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.lang.String type
protected java.util.Hashtable<java.lang.String,java.lang.String> attributes
protected java.util.Hashtable<java.lang.String,org.apache.ctakes.utils.xcas_comparison.XcasAnnotation.MyVector> references
protected java.util.Hashtable<java.lang.String,java.util.Vector<java.lang.Integer>> refIntArrays
Constructor Detail |
---|
public XcasAnnotation()
public XcasAnnotation(java.lang.String t)
t
- Type of the XcasAnnotation
object to be created.Method Detail |
---|
public void setType(java.lang.String t)
t
- Type to be set.public void insertAttribute(java.lang.String k, java.lang.String v)
XcasAnnotation
.
k
- Name of the attribute.v
- Value of the attribute.public void insertReference(java.lang.String k, XcasAnnotation a)
public void insertIntReference(java.lang.String k, int[] a)
public java.lang.String getAttribute(java.lang.String name)
name
- Name of the attribute.
public java.util.Vector<XcasAnnotation> getReference(java.lang.String name)
XcasAnnotation
s of the specified attribute.
name
- Name of an attribute that references to other XcasAnnotation
.
HashSet
of referenced public boolean equals(java.lang.Object obj)
XcasAnnotation a
equals to another one o
if and only if o
is also an XcasAnnotation
object
and a.type.equals(o.type) && a.attributes.equals(o.attributes) &&
a.references.equals(o.references)
.
equals
in class java.lang.Object
obj
- An object to compare with this one.
true
if the specified object equals this one,
false
otherwise.public java.lang.String getType()
public java.lang.String shortType()
XcasAnnotation
's type,
specifically, the last segment as separated by dots.
public java.lang.String allFieldsValues()
public java.lang.String description()
public java.lang.Object clone()
clone
in class java.lang.Object
public final XcasAnnotation shallowCopy()
public int compareTo(XcasAnnotation o)
XcasAnnotation
.
Note: It is strongly recommended that the use of this method be strictly
limited to the purpose of an orderly display of multiple objects.
To determine the equality of two objects, use equals(Object)
.
compareTo
in interface java.lang.Comparable<XcasAnnotation>
equals(Object)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |