## org.exist.xquery.value
Class SequenceType

    java.lang.Object
      org.exist.xquery.value.SequenceType

public class SequenceType
extends java.lang.Object

Represents an XQuery SequenceType and provides methods to check sequences and items against this type.

Author:
  wolf

Constructor Summary
`SequenceType()`
`SequenceType(int primaryType, int cardinality)` Construct a new SequenceType using the specified primary type and cardinality constants.

Method Summary
`void` `checkCardinality(Sequence seq)` Check if the given sequence has the cardinality required by this sequence type.
`void` `checkType(int type)` Check the given type against the primary type declared in this SequenceType.
`boolean` `checkType(Item item)` Check a single item against this SequenceType.
`boolean` `checkType(Sequence seq)` Check the specified sequence against this SequenceType.
`int` `getCardinality()` Returns the expected cardinality.
`QName` `getNodeName()`
`int` `getPrimaryType()` Returns the primary type as one of the constants defined in `Type`.
`void` `setCardinality(int cardinality)`
`void` `setNodeName(QName qname)`
`void` `setPrimaryType(int type)`
`java.lang.String` `toString()`

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### SequenceType

    public SequenceType()

### SequenceType

    public SequenceType(int primaryType,
                        int cardinality)

  Construct a new SequenceType using the specified primary type and cardinality constants.

Parameters:
  `primaryType` -
  `cardinality` -

Method Detail

### getPrimaryType

    public int getPrimaryType()

  Returns the primary type as one of the constants defined in `Type`.

### setPrimaryType

    public void setPrimaryType(int type)

### getCardinality

    public int getCardinality()

  Returns the expected cardinality. See the constants defined in `Cardinality`.

### setCardinality

    public void setCardinality(int cardinality)

### getNodeName

    public QName getNodeName()

### setNodeName

    public void setNodeName(QName qname)

### checkType

    public boolean checkType(Sequence seq)
                      throws XPathException

  Check the specified sequence against this SequenceType.

  Parameters:
    `seq` -
  Throws:
    `XPathException`
    `XPathException`

### checkType

    public boolean checkType(Item item)

  Check a single item against this SequenceType.

  Parameters:
    `item` -

### checkType

    public void checkType(int type)
                   throws XPathException

  Check the given type against the primary type declared in this SequenceType.

  Parameters:
    `type` -
  Throws:
    `XPathException`

### checkCardinality

    public void checkCardinality(Sequence seq)
                          throws XPathException

  Check if the given sequence has the cardinality required by this sequence type.

  Parameters:
    `seq` -
  Throws:
    `XPathException`

### toString

    public java.lang.String toString()

Copyright (C) Wolfgang Meier. All rights reserved.