sk.uniba.euromath.document.schema.impl.bca
Class BasicNcContainer

java.lang.Object
  extended by sk.uniba.euromath.document.schema.impl.bca.BasicNcContainer

public final class BasicNcContainer
extends Object

Immutable container of basic nameclass (one of SimpleNameClass, NamespaceNameClass,NameClass.ALL and LocalNameClass). Implements the equals() and hashCode() functions in order to be insertable into Set. The equals() function has also semantic of set equals: it returns true if and only if both nameclasses accepts same set of qnames.

Author:
Martin Vysny

Field Summary
static BasicNcContainer BASIC_NC_ALL
          Contains singleton instance of nameclass, that accepts anything.
 com.sun.msv.grammar.NameClass nameclass
          Enclosed basic nameclass.
 NcTypeEnum type
          Type of enclosed basic nameclass, one of NCTYPE_* constants.
 
Method Summary
 boolean accepts(QName qname)
          Checks if this nameclass accepts given qname.
 boolean accepts(String namespaceUri, String localPart)
          Checks if this nameclass accepts given qname.
 boolean equals(Object obj)
           
static BasicNcContainer getInstance(com.sun.msv.grammar.NameClass nameclass)
          Creates new container.
 int hashCode()
           
 BasicNcContainer intersection(BasicNcContainer nc)
          Computes intersection of our nameclass and given nameclass.
 boolean isSubsetOf(BasicNcContainer nc)
          Checks, whether this nameclass is subset of given basic nameclass.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

nameclass

public final com.sun.msv.grammar.NameClass nameclass
Enclosed basic nameclass.


type

public final NcTypeEnum type
Type of enclosed basic nameclass, one of NCTYPE_* constants.


BASIC_NC_ALL

public static final BasicNcContainer BASIC_NC_ALL
Contains singleton instance of nameclass, that accepts anything.

Method Detail

getInstance

public static BasicNcContainer getInstance(com.sun.msv.grammar.NameClass nameclass)
Creates new container. Returns BASIC_NC_ALL when nameclass accepts anything.

Parameters:
nameclass - container will represent this basic nameclass.
Returns:
instance of required container.

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object

isSubsetOf

public boolean isSubsetOf(BasicNcContainer nc)
Checks, whether this nameclass is subset of given basic nameclass.

Parameters:
nc - basic nameclass to check.
Returns:
true if this is subset of given nc, false otherwise.

intersection

public BasicNcContainer intersection(BasicNcContainer nc)
Computes intersection of our nameclass and given nameclass.

Parameters:
nc - basic nameclass.
Returns:
intersection of two nameclasses, or null, if result is an empty set.

accepts

public boolean accepts(QName qname)
Checks if this nameclass accepts given qname.

Parameters:
qname - qname to check.
Returns:
true if we accept given qname, false otherwise.

accepts

public boolean accepts(String namespaceUri,
                       String localPart)
Checks if this nameclass accepts given qname.

Parameters:
namespaceUri - uri
localPart - local name.
Returns:
true if we accept given qname, false otherwise.


Copyright © 2003-2006 null. All Rights Reserved.