Package org.basex.query.util.list
Class AnnList
- java.lang.Object
-
- org.basex.query.util.list.AnnList
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AnnList
attach(Ann ann)
Adds an annotation.AnnList
check(boolean variable, boolean visible)
Checks all annotations for parsing errors.boolean
contains(Ann ann)
Checks if the specified annotation is found in the list.boolean
contains(Annotation def)
Checks if the specified signature is found in the list.Ann
get(Annotation def)
Returns an annotation with the specified signature.AnnList
intersect(AnnList list)
Returns the intersection of these annotations and the given ones.boolean
isEmpty()
Tests whether the container has no elements.Iterator<Ann>
iterator()
int
size()
Returns the number of elements.void
toString(QueryString qs)
Adds the annotations to a query string.AnnList
union(AnnList list)
Returns the unions of these annotations and the given ones.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Field Detail
-
EMPTY
public static final AnnList EMPTY
Empty annotations.
-
-
Method Detail
-
contains
public boolean contains(Annotation def)
Checks if the specified signature is found in the list.- Parameters:
def
- signature to be found- Returns:
- result of check
-
contains
public boolean contains(Ann ann)
Checks if the specified annotation is found in the list.- Parameters:
ann
- annotation to be found- Returns:
- result of check
-
get
public Ann get(Annotation def)
Returns an annotation with the specified signature.- Parameters:
def
- annotation to be found- Returns:
- annotation or
null
-
attach
public AnnList attach(Ann ann)
Adds an annotation.- Parameters:
ann
- annotation to be added- Returns:
- a new instance
-
isEmpty
public boolean isEmpty()
Tests whether the container has no elements.- Returns:
- result of check
-
size
public int size()
Returns the number of elements.- Returns:
- number of elements
-
intersect
public AnnList intersect(AnnList list)
Returns the intersection of these annotations and the given ones.- Parameters:
list
- other annotations- Returns:
- a new instance with all annotations, or
null
if intersection is not possible
-
union
public AnnList union(AnnList list)
Returns the unions of these annotations and the given ones.- Parameters:
list
- annotations- Returns:
- a new instance with annotations that are present in both lists
-
check
public AnnList check(boolean variable, boolean visible) throws QueryException
Checks all annotations for parsing errors.- Parameters:
variable
- variable flag (triggers different error codes)visible
- check visibility annotations- Returns:
- self reference
- Throws:
QueryException
- query exception
-
toString
public void toString(QueryString qs)
Adds the annotations to a query string.- Parameters:
qs
- query string builder
-
-