Package net.sf.saxon.value
Class SequenceType
java.lang.Object
net.sf.saxon.value.SequenceType
- All Implemented Interfaces:
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:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final SequenceType
A type that allows any sequence of itemsstatic final SequenceType
A type that allows zero or more atomic valuesstatic final SequenceType
A type that only permits the empty sequencestatic final SequenceType
A type that allows a sequence of zero or more nodesstatic final SequenceType
A type that only permits a non-empty sequencestatic final SequenceType
A type that allows a sequence of zero or more numeric valuesstatic final SequenceType
A type that allows a single optional anyURIstatic final SequenceType
A type that allows zero or one atomic valuesstatic final SequenceType
A type that allows a single optional integerstatic final SequenceType
A type that allows a single optional bytestatic final SequenceType
A type that allows a single optional dateTimestatic final SequenceType
A type that allows a single optional decimalstatic final SequenceType
A type that allows a single document nodestatic final SequenceType
A type that allows a single optional doublestatic final SequenceType
A type that allows a single optional floatstatic final SequenceType
A type that allows a single optional intstatic final SequenceType
A type that allows a single optional integerstatic final SequenceType
A type that allows zero or one items, of any kindstatic final SequenceType
A type that allows a single optional longstatic final SequenceType
A type that allows zero or one nodesstatic final SequenceType
A type that allows an optional numeric valuestatic final SequenceType
A type that allows a single optional xs:QNamestatic final SequenceType
A type that allows a single optional shortstatic final SequenceType
A type that allows a single optional stringstatic final SequenceType
A type that allows exactly one atomic valuestatic final SequenceType
A type that allows a single booleanstatic final SequenceType
A type that allows a single shortstatic final SequenceType
A type that allows a single doublestatic final SequenceType
A type that allows a single element nodestatic final SequenceType
A type that allows a single floatstatic final SequenceType
A type that allows a single intstatic final SequenceType
A type that allows a single integerstatic final SequenceType
A type that allows exactly one item, of any kindstatic final SequenceType
A type that allows a single longstatic final SequenceType
A type that allows a single nodestatic final SequenceType
static final SequenceType
A type that allows a single shortstatic final SequenceType
A type that allows a single stringstatic final SequenceType
A type that allows a single untyped atomic -
Method Summary
Modifier and TypeMethodDescriptionboolean
Indicates whether some other object is "equal to" this one.int
Get the cardinality component of this SequenceType.Get the "primary" part of this required type.int
hashCode()
Returns a hash code value for the object.static SequenceType
makeSequenceType
(ItemType primaryType, int cardinality) Construct an instance of SequenceType.boolean
matches
(Value value, Configuration config) Determine whether a given value is a valid instance of this SequenceTypetoString()
Return a string representation of this SequenceType
-
Field Details
-
ANY_SEQUENCE
A type that allows any sequence of items -
SINGLE_ITEM
A type that allows exactly one item, of any kind -
OPTIONAL_ITEM
A type that allows zero or one items, of any kind -
SINGLE_ATOMIC
A type that allows exactly one atomic value -
OPTIONAL_ATOMIC
A type that allows zero or one atomic values -
ATOMIC_SEQUENCE
A type that allows zero or more atomic values -
SINGLE_STRING
A type that allows a single string -
SINGLE_UNTYPED_ATOMIC
A type that allows a single untyped atomic -
OPTIONAL_STRING
A type that allows a single optional string -
SINGLE_BOOLEAN
A type that allows a single boolean -
OPTIONAL_BOOLEAN
A type that allows a single optional integer -
SINGLE_INTEGER
A type that allows a single integer -
OPTIONAL_INTEGER
A type that allows a single optional integer -
SINGLE_LONG
A type that allows a single long -
OPTIONAL_LONG
A type that allows a single optional long -
SINGLE_INT
A type that allows a single int -
OPTIONAL_INT
A type that allows a single optional int -
SINGLE_SHORT
A type that allows a single short -
OPTIONAL_SHORT
A type that allows a single optional short -
SINGLE_BYTE
A type that allows a single short -
OPTIONAL_BYTE
A type that allows a single optional byte -
SINGLE_DOUBLE
A type that allows a single double -
OPTIONAL_DOUBLE
A type that allows a single optional double -
SINGLE_FLOAT
A type that allows a single float -
OPTIONAL_FLOAT
A type that allows a single optional float -
OPTIONAL_DECIMAL
A type that allows a single optional decimal -
OPTIONAL_ANY_URI
A type that allows a single optional anyURI -
OPTIONAL_DATE_TIME
A type that allows a single optional dateTime -
OPTIONAL_QNAME
A type that allows a single optional xs:QName -
OPTIONAL_NUMERIC
A type that allows an optional numeric value -
SINGLE_NUMERIC
-
OPTIONAL_NODE
A type that allows zero or one nodes -
SINGLE_NODE
A type that allows a single node -
OPTIONAL_DOCUMENT_NODE
A type that allows a single document node -
SINGLE_ELEMENT_NODE
A type that allows a single element node -
NODE_SEQUENCE
A type that allows a sequence of zero or more nodes -
NUMERIC_SEQUENCE
A type that allows a sequence of zero or more numeric values -
EMPTY_SEQUENCE
A type that only permits the empty sequence -
NON_EMPTY_SEQUENCE
A type that only permits a non-empty sequence
-
-
Method Details
-
makeSequenceType
Construct an instance of SequenceType. This is a factory method: it maintains a pool of SequenceType objects to reduce the amount of object creation.- Parameters:
primaryType
- The item typecardinality
- The required cardinality. This must be one of the constantsStaticProperty.EXACTLY_ONE
,StaticProperty.ALLOWS_ONE_OR_MORE
, etc- Returns:
- the SequenceType (either a newly created object, or an existing one from the cache)
-
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
-
getCardinality
public int getCardinality()Get the cardinality component of this SequenceType. This is one of the constantsStaticProperty.EXACTLY_ONE
,StaticProperty.ALLOWS_ONE_OR_MORE
, etc- Returns:
- the required cardinality
- See Also:
-
matches
Determine whether a given value is a valid instance of this SequenceType- Parameters:
value
- the value to be tested- Returns:
- true if the value is a valid instance of this type
- Throws:
XPathException
-
toString
Return a string representation of this SequenceType -
hashCode
public int hashCode()Returns a hash code value for the object. -
equals
Indicates whether some other object is "equal to" this one.
-