|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.languagecomputer.api.text.AnnotationType<T>
T
- The Text
sub-class that a AnnotationType
represents.public class AnnotationType<T extends Text>
Identifier for a particular type of annotation. Wraps a String
descriptor of an annotation. Allows for a hierarchical arrangement of
annotations. This allows for a more detailed description of an annotation
than the subclass of Text
to which it belongs. However, all
AnnotationType
s should be children of the base type for the
subclass of Text
from which is derives.
For example, if you create your own type of Entity
, you can give it
the special type Entity::MyEntity
without subclassing the
Entity
class. If you only wanted to retrieve your entity from a
Document
containing other types of entities, you can call
#getAnnotations(AnnotationType)
with that type. Alternatively, you
can call that method with the annotation type Entity
to get all
entities, including your own type.
Constructor Summary | |
---|---|
AnnotationType(String value)
Creates a new AnnotationType with the given value. |
Method Summary | |
---|---|
boolean |
equals(Object o)
Indicates that the given Object is an
AnnotationType exactly equal to this one. |
int |
hashCode()
hashCode implementation for an AnnotationType . |
boolean |
matches(AnnotationType that)
Indicates if the given AnnotationType is equal to or is a
super-type of this one. |
String |
toString()
Returns a String representation of this
AnnotationType . |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public AnnotationType(String value)
AnnotationType
with the given value.
value
- The String
value to use for this
AnnotationType
.
IllegalArgumentException
- If the given value is either
null
or empty, or if any of the component items is empty.Method Detail |
---|
public boolean matches(AnnotationType that)
AnnotationType
is equal to or is a
super-type of this one.
that
- The AnnotationType
to compare.
true
if that AnnotationType
is
equal to or less specific that this AnnotationType
,
false
otherwise.public boolean equals(Object o)
Object
is an
AnnotationType
exactly equal to this one.
equals
in class Object
o
- The Object
to compare for equality.
true
if o is an AnnotationType
exactly equal to this one, false
otherwise.public int hashCode()
hashCode
implementation for an AnnotationType
.
hashCode
in class Object
AnnotationType
.public String toString()
String
representation of this
AnnotationType
. This is the same value as what was given to
the constructor.
toString
in class Object
String
representation of this
AnnotationType
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |