| Method from org.apache.xmlbeans.QNameSet Detail: |
public boolean contains(QName name) {
boolean in = _includedURIs.contains(nsFromName(name)) ?
!_excludedQNames.contains(name) :
_includedQNames.contains(name);
return _inverted ^ in;
}
True if this ModelTransitionSet contains the given qname. |
public boolean containsAll(QNameSetSpecification set) {
// a.contains(b) == a.inverse.isDisjoint(b)
if (!_inverted && set.excludedURIs() != null)
return false;
return inverse().isDisjoint(set);
}
True if the given set is a subset of this one. |
public Set excludedQNamesInIncludedURIs() {
return Collections.unmodifiableSet(_inverted ? _includedQNames : _excludedQNames);
}
The set of QNames excluded from the set even though they are within
a namespace that is otherwise fully included in the set. |
public Set excludedURIs() {
if (_inverted) return Collections.unmodifiableSet(_includedURIs);
return null;
}
Namespaces that are fully excluded from the set except for a finite
number of individual QName exceptions. Returns null if this set is infinite. |
public static QNameSet forArray(QName[] includedQNames) {
if (includedQNames == null)
throw new IllegalArgumentException("includedQNames cannot be null");
return new QNameSet(null, Collections.EMPTY_SET, Collections.EMPTY_SET, new HashSet(Arrays.asList(includedQNames)));
}
Returns a QNameSet based on the given array of included QNames |
public static QNameSet forSets(Set excludedURIs,
Set includedURIs,
Set excludedQNamesInIncludedURIs,
Set includedQNamesInExcludedURIs) {
if ((excludedURIs != null) == (includedURIs != null))
throw new IllegalArgumentException("Exactly one of excludedURIs and includedURIs must be null");
if (excludedURIs == null && includedURIs.isEmpty() && includedQNamesInExcludedURIs.isEmpty())
return EMPTY;
if (includedURIs == null && excludedURIs.isEmpty() && excludedQNamesInIncludedURIs.isEmpty())
return ALL;
if (excludedURIs == null && includedURIs.size() == 1 && includedURIs.contains("") &&
includedQNamesInExcludedURIs.isEmpty() && excludedQNamesInIncludedURIs.isEmpty())
return LOCAL;
if (includedURIs == null && excludedURIs.size() == 1 && excludedURIs.contains("") &&
excludedQNamesInIncludedURIs.isEmpty() && includedQNamesInExcludedURIs.isEmpty())
return NONLOCAL;
return new QNameSet(
minSetCopy(excludedURIs),
minSetCopy(includedURIs),
minSetCopy(excludedQNamesInIncludedURIs),
minSetCopy(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. |
public static QNameSet forSpecification(QNameSetSpecification spec) {
if (spec instanceof QNameSet)
return (QNameSet)spec;
return QNameSet.forSets(spec.excludedURIs(), spec.includedURIs(), spec.excludedQNamesInIncludedURIs(), spec.includedQNamesInExcludedURIs());
}
Returns a QNameSet with the same contents as the given
QNameSetSpecification. |
public static QNameSet forWildcardNamespaceString(String wildcard,
String targetURI) {
return QNameSet.forSpecification(new QNameSetBuilder(wildcard, 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). |
public Set includedQNamesInExcludedURIs() {
return Collections.unmodifiableSet(_inverted ? _excludedQNames : _includedQNames);
}
The set of QNames included in the set even though they are within
a namespace that is otherwise fully included in the set. |
public Set includedURIs() {
if (!_inverted) return _includedURIs;
return null;
}
Namespaces that are fully included in set except for a finite
number of individual QName exceptions. Returns null if this set is infinite. |
public QNameSet intersect(QNameSetSpecification set) {
QNameSetBuilder result = new QNameSetBuilder(this);
result.restrict(set);
return result.toQNameSet();
}
Returns a new QNameSet that is the intersection of this one and another. |
public QNameSet inverse() {
if (this == EMPTY)
return ALL;
if (this == ALL)
return EMPTY;
if (this == LOCAL)
return NONLOCAL;
if (this == NONLOCAL)
return LOCAL;
return new QNameSet(includedURIs(), excludedURIs(), includedQNamesInExcludedURIs(), excludedQNamesInIncludedURIs());
}
Returns a new QNameSet that is the inverse of this one. |
public boolean isAll() {
return _inverted && _includedURIs.isEmpty() && _includedQNames.isEmpty();
}
True if this ModelTransitionSet contains all QNames. |
public boolean isDisjoint(QNameSetSpecification set) {
if (_inverted && set.excludedURIs() != null)
return false;
if (_inverted)
return isDisjointImpl(set, this);
else
return isDisjointImpl(this, set);
}
True if the given set is disjoint from this one. |
public boolean isEmpty() {
return !_inverted && _includedURIs.isEmpty() && _includedQNames.isEmpty();
}
True if this ModelTransitionSet contains no QNames. |
public static QNameSet singleton(QName name) {
return new QNameSet(null, Collections.EMPTY_SET, Collections.EMPTY_SET, Collections.singleton(name));
}
Returns a QNameSet containing only the given QName. |
public String toString() {
StringBuffer sb = new StringBuffer();
sb.append("QNameSet");
sb.append(_inverted ? "-(" : "+(");
for (Iterator i = _includedURIs.iterator(); i.hasNext(); )
{
sb.append("+*@");
sb.append(i.next());
sb.append(", ");
}
for (Iterator i = _excludedQNames.iterator(); i.hasNext(); )
{
sb.append("-");
sb.append(prettyQName((QName)i.next()));
sb.append(", ");
}
for (Iterator i = _includedQNames.iterator(); i.hasNext(); )
{
sb.append("+");
sb.append(prettyQName((QName)i.next()));
sb.append(", ");
}
int index = sb.lastIndexOf(", ");
if (index > 0)
sb.setLength(index);
sb.append(')");
return sb.toString();
}
Returns a string representation useful for debugging, subject to change. |
public QNameSet union(QNameSetSpecification set) {
QNameSetBuilder result = new QNameSetBuilder(this);
result.addAll(set);
return result.toQNameSet();
}
Returns a new QNameSet that is the union of this one and another. |