FileDocCategorySizeDatePackage
CMAny.javaAPI DocJava SE 6 API5571Tue Jun 10 00:22:40 BST 2008com.sun.org.apache.xerces.internal.impl.dtd.models

CMAny

public class CMAny extends CMNode
Content model any node.
xerces.internal
version
$Id: CMAny.java,v 1.1.2.1 2005/08/01 03:34:23 jeffsuttor Exp $

Fields Summary
private int
fType
The any content model type. This value is one of the following: XMLContentSpec.CONTENTSPECNODE_ANY, XMLContentSpec.CONTENTSPECNODE_ANY_OTHER, XMLContentSpec.CONTENTSPECNODE_ANY_LOCAL.
private String
fURI
URI of the any content model. This value is set if the type is of the following: XMLContentSpec.CONTENTSPECNODE_ANY, XMLContentSpec.CONTENTSPECNODE_ANY_OTHER.
private int
fPosition
Part of the algorithm to convert a regex directly to a DFA numbers each leaf sequentially. If its -1, that means its an epsilon node. Zero and greater are non-epsilon positions.
Constructors Summary
public CMAny(int type, String uri, int position)
Constructs a content model any.


    //
    // Constructors
    //

          
            
        super(type);

        // Store the information
        fType = type;
        fURI = uri;
        fPosition = position;
    
Methods Summary
protected voidcalcFirstPos(com.sun.org.apache.xerces.internal.impl.dtd.models.CMStateSet toSet)

        // If we are an epsilon node, then the first pos is an empty set
        if (fPosition == -1)
            toSet.zeroBits();

        // Otherwise, its just the one bit of our position
        else
            toSet.setBit(fPosition);
    
protected voidcalcLastPos(com.sun.org.apache.xerces.internal.impl.dtd.models.CMStateSet toSet)

        // If we are an epsilon node, then the last pos is an empty set
        if (fPosition == -1)
            toSet.zeroBits();

        // Otherwise, its just the one bit of our position
        else
            toSet.setBit(fPosition);
    
final intgetPosition()

        return fPosition;
    
final intgetType()

        return fType;
    
final java.lang.StringgetURI()

        return fURI;
    
public booleanisNullable()

        // Leaf nodes are never nullable unless its an epsilon node
        return (fPosition == -1);
    
final voidsetPosition(int newPosition)

        fPosition = newPosition;
    
public java.lang.StringtoString()

        StringBuffer strRet = new StringBuffer();
        strRet.append("(");
        strRet.append("##any:uri=");
        strRet.append(fURI);
        strRet.append(')");
        if (fPosition >= 0)
        {
            strRet.append
            (
                " (Pos:"
                + new Integer(fPosition).toString()
                + ")"
            );
        }
        return strRet.toString();