net.sf.saxon.om

## Interface Sequence

- All Known Subinterfaces:
    AtomicSequence, DocumentInfo, FunctionItem, GroundedValue, Item, MapItem, MutableNodeInfo, NodeInfo, SiblingCountingNode, SteppingNode<N>, VirtualNode
  All Known Implementing Classes:
    AbsentExtensionElement, AbstractFunctionItem, AbstractItem, AbstractNodeWrapper, AbstractVirtualNode, AnnotationParent, AnyURIValue, AtomicArray, AtomicConstructorFunctionItem, AtomicValue, AxiomAttributeWrapper, AxiomDocumentWrapper, AxiomElementNodeWrapper, AxiomLeafNodeWrapper, AxiomParentNodeWrapper, Base64BinaryValue, BigIntegerValue, BooleanValue, CalendarValue, CallableFunctionItem, Chain, Closure, CoercedFunction, CurriedFunction, DataElement, DateTimeValue, DateValue, DayTimeDurationValue, DecimalValue, DocumentImpl, DocumentWrapper, DOM4JDocumentWrapper, DOM4JNodeWrapper, DOMNodeWrapper, DoubleValue, DurationValue, ElementImpl, EmptyAtomicSequence, EmptySequence, ExtensionInstruction, FleetingDocumentNode, FleetingElementNode, FleetingNode, FleetingParentNode, FloatValue, GDateValue, GDayValue, GMonthDayValue, GMonthValue, GYearMonthValue, GYearValue, HexBinaryValue, ImmutableMap, IndexedValue, Int64Value, IntegerRange, IntegerValue, JDOM2DocumentWrapper, JDOM2NodeWrapper, JDOMDocumentWrapper, JDOMNodeWrapper, LazySequence, LiteralResultElement, MemoClosure, MemoSequence, NamespaceNode, NodeImpl, NotationValue, NumericValue, ObjectValue, Orphan, QNameValue, QualifiedNameValue, RangeKey, SaxonAssign, SaxonCallTemplate, SaxonCollation, SaxonDoctype, SaxonEntityRef, SaxonImportQuery, SaxonParam, SaxonPreprocess, SaxonWhile, SchemaElement, SequenceExtent, SingletonClosure, SingletonItem, SingletonMap, SpaceStrippedDocument, SpaceStrippedNode, SQLClose, SQLColumn, SQLConnect, SQLDelete, SQLExecute, SQLInsert, SQLQuery, SQLUpdate, StringValue, StyleElement, TextFragmentValue, TextImpl, TextValueTemplateNode, TimeValue, TinyDocumentImpl, TinyElementImpl, TinyNodeImpl, TinyParentNodeImpl, TinyTextImpl, Tuple, TypeStrippedDocument, TypeStrippedNode, UnconstructedDocument, UnconstructedElement, UnconstructedParent, UnknownElement, UntypedAtomicValue, UserFunctionItem, VirtualCopy, VirtualDocumentCopy, VirtualUntypedCopy, WhitespaceTextImpl, XOMDocumentWrapper, XOMNodeWrapper, XSDAlternative, XSDAnnotation, XSDAny, XSDAnyAttribute, XSDAssert, XSDAttribute, XSDAttributeGroup, XSDComplexContent, XSDComplexContentRestriction, XSDComplexType, XSDCompositor, XSDDefaultOpenContent, XSDDocumentation, XSDElement, XSDExtension, XSDFacet, XSDFieldOrSelector, XSDGroup, XSDIdentityConstraint, XSDImport, XSDInclude, XSDList, XSDNotation, XSDOpenContent, XSDOverride, XSDRedefine, XSDSchema, XSDSimpleContent, XSDSimpleContentRestriction, XSDSimpleType, XSDSimpleTypeRestriction, XSDUnion, XSLAccumulator, XSLAccumulatorRule, XSLAnalyzeString, XSLApplyImports, XSLApplyTemplates, XSLAssert, XSLAttribute, XSLAttributeSet, XSLBreak, XSLBreakOrContinue, XSLCallTemplate, XSLCatch, XSLCharacterMap, XSLChoose, XSLComment, XSLCopy, XSLCopyOf, XSLDecimalFormat, XSLDocument, XSLElement, XSLEvaluate, XSLFallback, XSLForEach, XSLForEachGroup, XSLFork, XSLFunction, XSLGeneralIncorporate, XSLGeneralVariable, XSLGlobalParam, XSLGlobalVariable, XSLIf, XSLImport, XSLImportSchema, XSLInclude, XSLIterate, XSLKey, XSLLeafNodeConstructor, XSLLocalParam, XSLLocalVariable, XSLMap, XSLMapEntry, XSLMatchingSubstring, XSLMerge, XSLMergeAction, XSLMergeKey, XSLMergeSource, XSLMessage, XSLMode, XSLNamespace, XSLNamespaceAlias, XSLNextIteration, XSLNextMatch, XSLNumber, XSLOnCompletion, XSLOtherwise, XSLOutput, XSLOutputCharacter, XSLPerformSort, XSLPreserveSpace, XSLProcessingInstruction, XSLResultDocument, XSLSequence, XSLSort, XSLSortOrMergeKey, XSLStream, XSLStylesheet, XSLTemplate, XSLText, XSLTry, XSLValueOf, XSLWhen, XSLWithParam, YearMonthDurationValue

      public interface Sequence

  This interface represents an XDM Value, that is, a sequence of items. Note that different implementations of Sequence might have very different With some sequences, calling iterate() may trigger evaluation of the logic that computes the sequence, and calling iterate() again may cause re-evaluation. Users should avoid assuming that a sequence of length one will always be represented as an instance of Item. If you are confident that the sequence will be of length one, call the head() function to get the first item.
  Since:
    9.5

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Item` | `head()` Get the first item in the sequence.
    `SequenceIterator<? extends Item>` | `iterate()` Get an iterator performance characteristics, though all should exhibit the same behaviour.over all the items in the sequence

- - ### Method Detail

    - #### head

          Item head()
                    throws XPathException

      Get the first item in the sequence.
      Returns:
        the first item in the sequence if there is one, or null if the sequence is empty
      Throws:
        `XPathException` - in the situation where the sequence is evaluated lazily, and evaluation of the first item causes a dynamic error.

    - #### iterate

          SequenceIterator<? extends Item> iterate()
                                                   throws XPathException

      Get an iterator performance characteristics, though all should exhibit the same behaviour.over all the items in the sequence
      Returns:
        an iterator over all the items
      Throws:
        `XPathException` - in the situation where the sequence is evaluated lazily, and constructing an iterator over the items causes a dynamic error.

Copyright (c) 2004-2013 Saxonica Limited. All rights reserved.