org.gxml.sa
Enum GxQuantifier

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

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

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 GxQuantifier approximate(int minOccurs, int maxOccurs)
          Approximates the schema minOccurs and maxOccurs with the GxQuantifier.
 GxQuantifier choice(GxQuantifier other)
           
 boolean contains(GxQuantifier other)
           
 boolean in(GxQuantifier... others)
          Determines whether this quantifier is contained in the specified set of quantifiers.
 boolean isEmpty()
           
 boolean isExactlyOne()
           
 boolean isNone()
           
 boolean isOptional()
           
 GxQuantifier product(GxQuantifier other)
           
 GxQuantifier 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
 GxQuantifier sum(GxQuantifier other)
           
 java.lang.String toString()
           
static GxQuantifier valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static GxQuantifier[] 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 GxQuantifier NONE

EMPTY

public static final GxQuantifier EMPTY

EXACTLY_ONE

public static final GxQuantifier EXACTLY_ONE

OPTIONAL

public static final GxQuantifier OPTIONAL

ONE_OR_MORE

public static final GxQuantifier ONE_OR_MORE

ZERO_OR_MORE

public static final GxQuantifier ZERO_OR_MORE
Method Detail

values

public static GxQuantifier[] 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 (GxQuantifier c : GxQuantifier.values())
    System.out.println(c);

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

valueOf

public static GxQuantifier 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(GxQuantifier other)

in

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


sum

public GxQuantifier sum(GxQuantifier other)

choice

public GxQuantifier choice(GxQuantifier other)

product

public GxQuantifier product(GxQuantifier other)

isNone

public boolean isNone()

isEmpty

public boolean isEmpty()

isOptional

public boolean isOptional()

isExactlyOne

public boolean isExactlyOne()

single

public GxQuantifier 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<GxQuantifier>

approximate

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

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


Copyright © 2009 TIBCO Software Inc. All Rights Reserved.