public class XcasAnnotation extends Object implements Cloneable, Comparable<XcasAnnotation>
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.
Modifier and Type | Field and Description |
---|---|
protected Hashtable<String,String> |
attributes |
protected Hashtable<String,org.apache.ctakes.utils.xcas_comparison.XcasAnnotation.MyVector> |
references |
protected Hashtable<String,Vector<Integer>> |
refIntArrays |
protected String |
type |
Constructor and Description |
---|
XcasAnnotation()
Default constructor.
|
XcasAnnotation(String t)
Constructs an object with the specified type.
|
Modifier and Type | Method and Description |
---|---|
String |
allFieldsValues()
Returns a string representation of all the attributes and references.
|
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 . |
String |
description()
Returns a String representation of this object, including its type, and
all attributes and references.
|
boolean |
equals(Object obj)
Determines whether the specified object equals to this one.
|
String |
getAttribute(String name)
Returns the value of the specified attribute.
|
Vector<XcasAnnotation> |
getReference(String name)
Returns the referenced
XcasAnnotation s of the specified attribute. |
String |
getType() |
void |
insertAttribute(String k,
String v)
Inserts an (attribute, value) pair to this
XcasAnnotation . |
void |
insertIntReference(String k,
int[] a) |
void |
insertReference(String k,
XcasAnnotation a) |
void |
setType(String t)
Sets the type name of this annotation.
|
XcasAnnotation |
shallowCopy()
Clones this object, its attributes, and reference keys.
|
String |
shortType()
Returns a short description of this
XcasAnnotation 's type,
specifically, the last segment as separated by dots. |
protected String type
protected Hashtable<String,org.apache.ctakes.utils.xcas_comparison.XcasAnnotation.MyVector> references
public XcasAnnotation()
public XcasAnnotation(String t)
t
- Type of the XcasAnnotation
object to be created.public void setType(String t)
t
- Type to be set.public void insertAttribute(String k, String v)
XcasAnnotation
.k
- Name of the attribute.v
- Value of the attribute.public void insertReference(String k, XcasAnnotation a)
public void insertIntReference(String k, int[] a)
public String getAttribute(String name)
name
- Name of the attribute.public Vector<XcasAnnotation> getReference(String name)
XcasAnnotation
s of the specified attribute.name
- Name of an attribute that references to other XcasAnnotation
.HashSet
of referenced public boolean equals(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)
.public String getType()
public String shortType()
XcasAnnotation
's type,
specifically, the last segment as separated by dots.public String allFieldsValues()
public String description()
public Object clone()
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 Comparable<XcasAnnotation>
equals(Object)
Copyright © 2012-2017 The Apache Software Foundation. All Rights Reserved.