All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.sun.msv.grammar.NotNameClass Maven / Gradle / Ivy

There is a newer version: 2.2.5.1
Show newest version
/*
 * @(#)$Id: NotNameClass.java,v 1.10 2003/06/09 20:37:17 kk122374 Exp $
 *
 * Copyright 2001 Sun Microsystems, Inc. All Rights Reserved.
 * 
 * This software is the proprietary information of Sun Microsystems, Inc.  
 * Use is subject to license terms.
 * 
 */
package com.sun.msv.grammar;

/**
 * NameClass that acts a not operator.
 * 
 * Actually, A NotNameClass can be represented by using a DifferenceNameClass
 * and AnyNameClass.
 * 
 * @author Kohsuke KAWAGUCHI
 */
public final class NotNameClass extends NameClass {
    public final NameClass child;

    /**
     * accepts a name if it is not accepted by the child name class.
     */
    public boolean accepts( String namespaceURI, String localName ) {
        return !child.accepts(namespaceURI,localName);
    }
    
    public Object visit( NameClassVisitor visitor ) { return visitor.onNot(this); }

    public NotNameClass( NameClass child ) {
        this.child = child;
    }
    
    public String toString()    { return "~"+child.toString(); }
    
    // serialization support
    private static final long serialVersionUID = 1;    
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy