Top Description Fields Constructors Methods
com.sun.tools.rngom.nc

public abstract Class NameClass

extends Object
implements ParsedNameClass, Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable, com.sun.tools.rngom.ast.om.ParsedNameClass
Known Direct Subclasses
com.sun.tools.rngom.nc.NsNameClass, com.sun.tools.rngom.nc.NsNameExceptNameClass, com.sun.tools.rngom.nc.NullNameClass, com.sun.tools.rngom.nc.SimpleNameClass, com.sun.tools.rngom.nc.AnyNameClass, com.sun.tools.rngom.nc.AnyNameExceptNameClass, com.sun.tools.rngom.nc.ChoiceNameClass
Imports
com.sun.tools.rngom.ast.om.ParsedNameClass, javax.xml.namespace.QName, java.io.Serializable, java.util.HashSet, .Set

Name class is a set of QNames.

Field Summary

Modifier and TypeField and Description
public static final NameClass
ANY

Sigleton instance that represents "anyName".

public static final NameClass
NULL

Sigleton instance that accepts no name.

private static final long
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final int

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public abstract <V> V
accept(NameClassVisitor<V> visitor)

Visitor pattern support.

public abstract boolean
contains(QName name)

Returns true if the given QName is a valid name for this QName.

public abstract int
public final boolean
hasOverlapWith(NameClass nc2)

Returns true if the intersection between this name class and the specified name class is non-empty.

public abstract boolean
isOpen()

Returns true if the name class accepts infinite number of QNames.

public Set<QName>
listNames()

If the name class is closed (IOW !

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ANYback to summary
public static final NameClass ANY

Sigleton instance that represents "anyName".

NULLback to summary
public static final NameClass NULL

Sigleton instance that accepts no name.

This instance is useful when doing boolean arithmetic over name classes (such as computing an inverse of a given name class, etc), even though it can never appear in a RELAX NG surface syntax.

Internally, this instance is also used for:

  1. Used to recover from errors during parsing.
  2. Mark element patterns with <notAllowed/> content model.
serialVersionUIDback to summary
private static final long serialVersionUID
SPECIFICITY_ANY_NAMEback to summary
pack-priv static final int SPECIFICITY_ANY_NAME
SPECIFICITY_NAMEback to summary
pack-priv static final int SPECIFICITY_NAME
SPECIFICITY_NONEback to summary
pack-priv static final int SPECIFICITY_NONE
SPECIFICITY_NS_NAMEback to summary
pack-priv static final int SPECIFICITY_NS_NAME

Constructor Detail

NameClassback to summary
public NameClass()

Method Detail

acceptback to summary
public abstract <V> V accept(NameClassVisitor<V> visitor)

Visitor pattern support.

containsback to summary
public abstract boolean contains(QName name)

Returns true if the given QName is a valid name for this QName.

containsSpecificityback to summary
public abstract int containsSpecificity(QName name)
hasOverlapWithback to summary
public final boolean hasOverlapWith(NameClass nc2)

Returns true if the intersection between this name class and the specified name class is non-empty.

isOpenback to summary
public abstract boolean isOpen()

Returns true if the name class accepts infinite number of QNames.

Intuitively, this method returns true if the name class is some sort of wildcard.

listNamesback to summary
public Set<QName> listNames()

If the name class is closed (IOW !isOpen()), return the set of names in this name class. Otherwise the behavior is undefined.