org.basex.query.value.type
Enum SeqType.Occ

java.lang.Object
  extended by java.lang.Enum<SeqType.Occ>
      extended by org.basex.query.value.type.SeqType.Occ
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<SeqType.Occ>
Enclosing class:
SeqType

public static enum SeqType.Occ
extends java.lang.Enum<SeqType.Occ>

Number of occurrences (cardinality).


Enum Constant Summary
ONE
          Exactly one.
ONE_MORE
          One or more.
ZERO
          Zero.
ZERO_MORE
          Zero or more.
ZERO_ONE
          Zero or one.
 
Field Summary
 int max
          Maximal number of occurrences.
 int min
          Minimal number of occurrences.
 
Method Summary
 boolean check(long c)
          Checks if the given cardinality is supported by this type.
 boolean instanceOf(SeqType.Occ o)
          Checks if the specified occurrence indicator is an instance of the current occurrence indicator.
 SeqType.Occ intersect(SeqType.Occ other)
          Computes the intersection between this occurrence indicator and the given one.
 java.lang.String toString()
           
 SeqType.Occ union(SeqType.Occ other)
          Computes the union between this occurrence indicator and the given one.
static SeqType.Occ valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static SeqType.Occ[] 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

ZERO

public static final SeqType.Occ ZERO
Zero.


ZERO_ONE

public static final SeqType.Occ ZERO_ONE
Zero or one.


ONE

public static final SeqType.Occ ONE
Exactly one.


ONE_MORE

public static final SeqType.Occ ONE_MORE
One or more.


ZERO_MORE

public static final SeqType.Occ ZERO_MORE
Zero or more.

Field Detail

min

public final int min
Minimal number of occurrences.


max

public final int max
Maximal number of occurrences.

Method Detail

values

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

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

valueOf

public static SeqType.Occ 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

instanceOf

public boolean instanceOf(SeqType.Occ o)
Checks if the specified occurrence indicator is an instance of the current occurrence indicator.

Parameters:
o - occurrence indicator to check
Returns:
result of check

intersect

public SeqType.Occ intersect(SeqType.Occ other)
Computes the intersection between this occurrence indicator and the given one. If none exists (e.g. between ZERO and ONE), null is returned.

Parameters:
other - other occurrence indicator
Returns:
intersection or null

union

public SeqType.Occ union(SeqType.Occ other)
Computes the union between this occurrence indicator and the given one.

Parameters:
other - other occurrence indicator
Returns:
union

check

public boolean check(long c)
Checks if the given cardinality is supported by this type.

Parameters:
c - cardinality
Returns:
result of check

toString

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