Class AnnList

  • All Implemented Interfaces:
    Iterable<Ann>

    public final class AnnList
    extends Object
    implements Iterable<Ann>
    List of annotations.
    Author:
    BaseX Team 2005-24, BSD License, Christian Gruen
    • 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