Package org.apache.xmlbeans

## Class QNameSet

- java.lang.Object
- - org.apache.xmlbeans.QNameSet

- All Implemented Interfaces:
    `Serializable`, `QNameSetSpecification`

      public final class QNameSet
      extends Object
      implements QNameSetSpecification, Serializable

  This interface represents a lattice of finite and infinite sets of QNames. The lattice the minimal one that is closed under union, intersection, and inverse, and contains individual QNames as well as entire namespaces. Here is a summary of the two kinds of QNameSets:
  - A QNameSet can cover a finite set of namespaces, additionally including a finite set of QNames outside those namespaces, and with the exception of a finite set of QNames excluded from those namespaes:
    - excludedQNamesInIncludedURIs == the set of excluded QNames from coveredURIs namespaces
    - excludedURIs == null
    - includedURIs == the set of covered namespace URIs
    - includedQNamesInExcludedURIs == set of additional QNames outside coveredURIs namespaces
  - A QNameSet can cover all namespaces except for a finite number of excluded ones, additionally including a finite set of QNames within the excluded namespaces, and with the exception of a finite set of QNames outside the excluded namespaces:
    - excludedQNamesInIncludedURIs == the set of excluded QNames outside uncoveredURIs namespaces
    - excludedURIs == the set of uncovered namespace URIs
    - includedURIs == null
    - includedQNamesInExcludedURIs == set of additional QNames from uncoveredURIs namespaces

  Notice that a finite set of QNames is a degenerate case of the first category outlined above:

  - A QnameSet can contain a finite number of QNames:
    - excludedQNamesInIncludedURIs == empty set
    - excludedURIs == null
    - includedURIs == empty set
    - includedQNamesInExcludedURIs == set of included QNames
  See Also:
    `QNameSetBuilder`, Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `static QNameSet` | `ALL` | The QNameSet containing all QNames.
    `static QNameSet` | `EMPTY` | The empty QNameSet.
    `static QNameSet` | `LOCAL` | The QNameSet containing all QNames in the local (no-)namespace.
    `static QNameSet` | `NONLOCAL` | The QNameSet containing all QNames except for those in the local (no-)namespace.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `boolean` | `contains​(QName name)` | True if this ModelTransitionSet contains the given qname.
    `boolean` | `containsAll​(QNameSetSpecification set)` | True if the given set is a subset of this one.
    `Set<QName>` | `excludedQNamesInIncludedURIs()` | The set of QNames excluded from the set even though they are within a namespace that is otherwise fully included in the set.
    `Set<String>` | `excludedURIs()` | Namespaces that are fully excluded from the set except for a finite number of individual QName exceptions.
    `static QNameSet` | `forArray​(QName[] includedQNames)` | Returns a QNameSet based on the given array of included QNames
    `static QNameSet` | `forSets​(Set<String> excludedURIs, Set<String> includedURIs, Set<QName> excludedQNamesInIncludedURIs, Set<QName> includedQNamesInExcludedURIs)` | Returns a QNameSet based on the given sets of excluded URIs, included URIs, excluded QNames in included namespaces, and included QNames in excluded namespaces.
    `static QNameSet` | `forSpecification​(QNameSetSpecification spec)` | Returns a QNameSet with the same contents as the given QNameSetSpecification.
    `static QNameSet` | `forWildcardNamespaceString​(String wildcard, String targetURI)` | Returns a QNameSet corresponding to the given wildcard namespace string.
    `Set<QName>` | `includedQNamesInExcludedURIs()` | The set of QNames included in the set even though they are within a namespace that is otherwise fully included in the set.
    `Set<String>` | `includedURIs()` | Namespaces that are fully included in set except for a finite number of individual QName exceptions.
    `QNameSet` | `intersect​(QNameSetSpecification set)` | Returns a new QNameSet that is the intersection of this one and another.
    `QNameSet` | `inverse()` | Returns a new QNameSet that is the inverse of this one.
    `boolean` | `isAll()` | True if this ModelTransitionSet contains all QNames.
    `boolean` | `isDisjoint​(QNameSetSpecification set)` | True if the given set is disjoint from this one.
    `boolean` | `isEmpty()` | True if this ModelTransitionSet contains no QNames.
    `static QNameSet` | `singleton​(QName name)` | Returns a QNameSet containing only the given QName.
    `String` | `toString()` | Returns a string representation useful for debugging, subject to change.
    `QNameSet` | `union​(QNameSetSpecification set)` | Returns a new QNameSet that is the union of this one and another.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### EMPTY

          public static final QNameSet EMPTY

      The empty QNameSet.

    - #### ALL

          public static final QNameSet ALL

      The QNameSet containing all QNames.

    - #### LOCAL

          public static final QNameSet LOCAL

      The QNameSet containing all QNames in the local (no-)namespace.

    - #### NONLOCAL

          public static final QNameSet NONLOCAL

      The QNameSet containing all QNames except for those in the local (no-)namespace.

  - ### Method Detail

    - #### forSets

          public static QNameSet forSets​(Set<String> excludedURIs,
                                         Set<String> includedURIs,
                                         Set<QName> excludedQNamesInIncludedURIs,
                                         Set<QName> includedQNamesInExcludedURIs)

      Returns a QNameSet based on the given sets of excluded URIs, included URIs, excluded QNames in included namespaces, and included QNames in excluded namespaces.
      Parameters:
        `excludedURIs` - the finite set of namespace URI strings to exclude from the set, or null if this set is infinite
        `includedURIs` - the finite set of namespace URI strings to include in the set, or null if this set is infinite
        `excludedQNamesInIncludedURIs` - the finite set of exceptional QNames to exclude from the included namespaces
        `includedQNamesInExcludedURIs` - the finite set of exceptional QNames to include that are in the excluded namespaces
      Returns:
        the constructed QNameSet

    - #### forArray

          public static QNameSet forArray​(QName[] includedQNames)

      Returns a QNameSet based on the given array of included QNames
      Parameters:
        `includedQNames` - the array of included QNames

    - #### forSpecification

          public static QNameSet forSpecification​(QNameSetSpecification spec)

      Returns a QNameSet with the same contents as the given QNameSetSpecification.
      Returns:
        the copied QNameSet

    - #### forWildcardNamespaceString

          public static QNameSet forWildcardNamespaceString​(String wildcard,
                                                            String targetURI)

      Returns a QNameSet corresponding to the given wildcard namespace string. This is a space-separated list of URIs, plus special tokens as specified in the XML Schema specification (##any, ##other, ##targetNamespace, ##local).
      Returns:
        the constructed QNameSet

    - #### singleton

          public static QNameSet singleton​(QName name)

      Returns a QNameSet containing only the given QName.
      Returns:
        the constructed QNameSet

    - #### contains

          public boolean contains​(QName name)

      True if this ModelTransitionSet contains the given qname.
      Specified by:
        `contains` in interface `QNameSetSpecification`

    - #### isAll

          public boolean isAll()

      True if this ModelTransitionSet contains all QNames.
      Specified by:
        `isAll` in interface `QNameSetSpecification`

    - #### isEmpty

          public boolean isEmpty()

      True if this ModelTransitionSet contains no QNames.
      Specified by:
        `isEmpty` in interface `QNameSetSpecification`

    - #### intersect

          public QNameSet intersect​(QNameSetSpecification set)

      Returns a new QNameSet that is the intersection of this one and another.
      Specified by:
        `intersect` in interface `QNameSetSpecification`
      Parameters:
        `set` - the set to insersect with
      Returns:
        the intersection

    - #### union

          public QNameSet union​(QNameSetSpecification set)

      Returns a new QNameSet that is the union of this one and another.
      Specified by:
        `union` in interface `QNameSetSpecification`
      Parameters:
        `set` - the set to union with
      Returns:
        the union

    - #### inverse

          public QNameSet inverse()

      Returns a new QNameSet that is the inverse of this one.
      Specified by:
        `inverse` in interface `QNameSetSpecification`

    - #### containsAll

          public boolean containsAll​(QNameSetSpecification set)

      True if the given set is a subset of this one.
      Specified by:
        `containsAll` in interface `QNameSetSpecification`
      Parameters:
        `set` - the set to test
      Returns:
        true if this contains all QNames contained by the given set

    - #### isDisjoint

          public boolean isDisjoint​(QNameSetSpecification set)

      True if the given set is disjoint from this one.
      Specified by:
        `isDisjoint` in interface `QNameSetSpecification`
      Parameters:
        `set` - the set to test
      Returns:
        true if the set is disjoint from this set

    - #### excludedURIs

          public Set<String> excludedURIs()

      Namespaces that are fully excluded from the set except for a finite number of individual QName exceptions. Returns null if this set is infinite.
      Specified by:
        `excludedURIs` in interface `QNameSetSpecification`
      Returns:
        the set of excluded namespace URI strings

    - #### includedURIs

          public Set<String> includedURIs()

      Namespaces that are fully included in set except for a finite number of individual QName exceptions. Returns null if this set is infinite.
      Specified by:
        `includedURIs` in interface `QNameSetSpecification`
      Returns:
        the set of included namespace URI strings

    - #### excludedQNamesInIncludedURIs

          public Set<QName> excludedQNamesInIncludedURIs()

      The set of QNames excluded from the set even though they are within a namespace that is otherwise fully included in the set.
      Specified by:
        `excludedQNamesInIncludedURIs` in interface `QNameSetSpecification`
      Returns:
        the set of excluded QNames from within includedURI namespaces

    - #### includedQNamesInExcludedURIs

          public Set<QName> includedQNamesInExcludedURIs()

      The set of QNames included in the set even though they are within a namespace that is otherwise fully included in the set.
      Specified by:
        `includedQNamesInExcludedURIs` in interface `QNameSetSpecification`
      Returns:
        the set of included QNames from within excludedURI namespaces

    - #### toString

          public String toString()

      Returns a string representation useful for debugging, subject to change.
      Overrides:
        `toString` in class `Object`