You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by lm...@apache.org on 2001/11/25 19:47:37 UTC

cvs commit: xml-xerces/java/src/org/apache/xerces/impl/xs XSParticleDecl.java

lmartin     01/11/25 10:47:37

  Modified:    java/src/org/apache/xerces/impl/xs XSParticleDecl.java
  Log:
  Added an isEmpty method
  
  Revision  Changes    Path
  1.2       +13 -1     xml-xerces/java/src/org/apache/xerces/impl/xs/XSParticleDecl.java
  
  Index: XSParticleDecl.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/xs/XSParticleDecl.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- XSParticleDecl.java	2001/10/25 20:36:02	1.1
  +++ XSParticleDecl.java	2001/11/25 18:47:37	1.2
  @@ -62,7 +62,7 @@
    *
    * @author Sandy Gao, IBM
    *
  - * @version $Id: XSParticleDecl.java,v 1.1 2001/10/25 20:36:02 elena Exp $
  + * @version $Id: XSParticleDecl.java,v 1.2 2001/11/25 18:47:37 lmartin Exp $
    */
   public class XSParticleDecl {
   
  @@ -98,6 +98,18 @@
        */
       public boolean emptiable() {
           return minEffectiveTotalRange() == 0;
  +    }
  +
  +    public boolean isEmpty() {
  +        if (fType==PARTICLE_ELEMENT || fType==PARTICLE_WILDCARD) return false; 
  +
  +        if (fType==PARTICLE_EMPTY) return true; 
  +        
  +        boolean leftIsEmpty  = (fValue==null || ((XSParticleDecl)fValue).isEmpty());
  +        boolean rightIsEmpty  = (fOtherValue==null || 
  +                                 ((XSParticleDecl)fOtherValue).isEmpty());
  +
  +        return (leftIsEmpty && rightIsEmpty) ;
       }
   
       /**
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-cvs-help@xml.apache.org