org.gxml.xs
Enum SmQuantifier

java.lang.Object
  extended by java.lang.Enum<SmQuantifier>
      extended by org.gxml.xs.SmQuantifier
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<SmQuantifier>

public enum SmQuantifier
extends java.lang.Enum<SmQuantifier>

The quantifier approximates the possible number of items in a sequence type with the occurrence indicators supported by the XPath/XQuery type system (?, +, *).

For interim results, the auxiliary occurrence indicator 1 denotes exactly one occurrence.


Enum 0 1 * toString()
NONE 0 0 0 none
EMPTY 1 0 0 empty
EXACTLY_ONE 0 1 0 1
OPTIONAL 1 1 0 ?
ONE_OR_MORE 0 1 1 +
ZERO_OR_MORE 1 1 1 *


Enum Constant Summary
EMPTY
           
EXACTLY_ONE
           
NONE
           
ONE_OR_MORE
           
OPTIONAL
           
ZERO_OR_MORE
           
 
Method Summary
static SmQuantifier approximate(int minOccurs, int maxOccurs)
          Approximates the schema minOccurs and maxOccurs with the SmQuantifier.
 SmQuantifier choice(SmQuantifier other)
           
 boolean contains(SmQuantifier other)
           
 boolean in(SmQuantifier... others)
          Determines whether this quantifier is contained in the specified set of quantifiers.
 boolean isEmpty()
           
 boolean isExactlyOne()
           
 boolean isNone()
           
 boolean isOptional()
           
 SmQuantifier product(SmQuantifier other)
           
 SmQuantifier single()
          Computes the quantifier for a type V when it is replaced by V[1] according to the following table:
this aggregate ? ? * ? 1 1 + 1 none none empty empty
 SmQuantifier sum(SmQuantifier other)
           
 java.lang.String toString()
           
static SmQuantifier valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static SmQuantifier[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

NONE

public static final SmQuantifier NONE

EMPTY

public static final SmQuantifier EMPTY

EXACTLY_ONE

public static final SmQuantifier EXACTLY_ONE

OPTIONAL

public static final SmQuantifier OPTIONAL

ONE_OR_MORE

public static final SmQuantifier ONE_OR_MORE

ZERO_OR_MORE

public static final SmQuantifier ZERO_OR_MORE
Method Detail

values

public static SmQuantifier[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (SmQuantifier c : SmQuantifier.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static SmQuantifier valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null

contains

public boolean contains(SmQuantifier other)

in

public boolean in(SmQuantifier... others)
Determines whether this quantifier is contained in the specified set of quantifiers.


sum

public SmQuantifier sum(SmQuantifier other)

choice

public SmQuantifier choice(SmQuantifier other)

product

public SmQuantifier product(SmQuantifier other)

isNone

public boolean isNone()

isEmpty

public boolean isEmpty()

isOptional

public boolean isOptional()

isExactlyOne

public boolean isExactlyOne()

single

public SmQuantifier single()
Computes the quantifier for a type V when it is replaced by V[1] according to the following table:
this aggregate
? ?
* ?
1 1
+ 1
none none
empty empty


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Enum<SmQuantifier>

approximate

public static SmQuantifier approximate(int minOccurs,
                                       int maxOccurs)
Approximates the schema minOccurs and maxOccurs with the SmQuantifier.

Parameters:
minOccurs - The min-occurs value.
maxOccurs - The max-occurs value.
Returns:
The SmQuantifier approximation.


Copyright © 2009 TIBCO Software Inc. All Rights Reserved.