net.sf.saxon.value
Class SequenceType

java.lang.Object
  |
  +--net.sf.saxon.value.SequenceType
All Implemented Interfaces:
java.io.Serializable

public final class SequenceType
extends java.lang.Object
implements java.io.Serializable

SequenceType: a sequence type consists of a primary type, which indicates the type of item, and a cardinality, which indicates the number of occurrences permitted. Where the primary type is element or attribute, there may also be a content type, indicating the required type annotation on the element or attribute content.

See Also:
Serialized Form

Field Summary
static SequenceType ANY_SEQUENCE
          A type that allows any sequence of items
static SequenceType NODE_SEQUENCE
          A type that allows a sequence of zero or more nodes
static SequenceType NUMERIC_SEQUENCE
          A type that allows a sequence of zero or more numeric values
static SequenceType OPTIONAL_ATOMIC
          A type that allows zero or one atomic values
static SequenceType OPTIONAL_ITEM
          A type that allows zero or one items, of any kind
static SequenceType SINGLE_INTEGER
          A type that allows a single integer
static SequenceType SINGLE_ITEM
          A type that allows exactly one item, of any kind
static SequenceType SINGLE_NODE
          A type that allows a single node
static SequenceType SINGLE_STRING
          A type that allows a single string
 
Constructor Summary
SequenceType(int primaryType, int contentType, int cardinality)
          Construct an instance of SequenceType
 
Method Summary
 int getCardinality()
          Get the cardinality component of this SequenceType.
 int getContentType()
          Get the content type of this SequenceType.
 int getPrimaryType()
          Get the "primary" part of this required type.
 java.lang.String toString()
          Return a string representation of this SequenceType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ANY_SEQUENCE

public static final SequenceType ANY_SEQUENCE
A type that allows any sequence of items


SINGLE_ITEM

public static final SequenceType SINGLE_ITEM
A type that allows exactly one item, of any kind


OPTIONAL_ITEM

public static final SequenceType OPTIONAL_ITEM
A type that allows zero or one items, of any kind


OPTIONAL_ATOMIC

public static final SequenceType OPTIONAL_ATOMIC
A type that allows zero or one atomic values


SINGLE_STRING

public static final SequenceType SINGLE_STRING
A type that allows a single string


SINGLE_INTEGER

public static final SequenceType SINGLE_INTEGER
A type that allows a single integer


SINGLE_NODE

public static final SequenceType SINGLE_NODE
A type that allows a single node


NODE_SEQUENCE

public static final SequenceType NODE_SEQUENCE
A type that allows a sequence of zero or more nodes


NUMERIC_SEQUENCE

public static final SequenceType NUMERIC_SEQUENCE
A type that allows a sequence of zero or more numeric values

Constructor Detail

SequenceType

public SequenceType(int primaryType,
                    int contentType,
                    int cardinality)
Construct an instance of SequenceType

Parameters:
primaryType - The primary part of the type, e.g. element or attribute
contentType - The content part of the type, e.g. xs:date (or ITEM in the case where the primary type is sufficient)
cardinality - The required cardinality
Method Detail

getPrimaryType

public int getPrimaryType()
Get the "primary" part of this required type. E.g. for type element(*, xs:date) the "primary type" is element()

Returns:
The item type code of the primary type

getContentType

public int getContentType()
Get the content type of this SequenceType. For example, the "content type" of element(*, xs:date) is "xs:date".

Returns:
The item type code of the content type

getCardinality

public int getCardinality()
Get the cardinality component of this SequenceType. This is one of the constants Cardinality.EXACTLY_ONE, Cardinality.ONE_OR_MORE, etc

Returns:
the required cardinality
See Also:
Cardinality

toString

public java.lang.String toString()
Return a string representation of this SequenceType

Overrides:
toString in class java.lang.Object
Returns:
the string representation as an instance of the XPath SequenceType construct