net.sf.saxon.om

## Interface GroundedValue

- All Superinterfaces:
    Sequence
  All Known Subinterfaces:
    AtomicSequence, FunctionItem, MapItem
  All Known Implementing Classes:
    AbstractFunctionItem, AbstractItem, AnyURIValue, AtomicArray, AtomicConstructorFunctionItem, AtomicValue, Base64BinaryValue, BigIntegerValue, BooleanValue, CalendarValue, CallableFunctionItem, Chain, CoercedFunction, CurriedFunction, DateTimeValue, DateValue, DayTimeDurationValue, DecimalValue, DoubleValue, DurationValue, EmptyAtomicSequence, EmptySequence, FloatValue, GDateValue, GDayValue, GMonthDayValue, GMonthValue, GYearMonthValue, GYearValue, HexBinaryValue, ImmutableMap, IndexedValue, Int64Value, IntegerRange, IntegerValue, NotationValue, NumericValue, ObjectValue, QNameValue, QualifiedNameValue, RangeKey, SequenceExtent, SingletonItem, SingletonMap, StringValue, TimeValue, Tuple, UntypedAtomicValue, UserFunctionItem, YearMonthDurationValue

      public interface GroundedValue
      extends Sequence

  A value that exists in memory and that can be directly addressed

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `effectiveBooleanValue()` Get the effective boolean value of this sequence
    `int` | `getLength()` Get the size of the value (the number of items)
    `String` | `getStringValue()` Get the string value of this sequence.
    `CharSequence` | `getStringValueCS()` Get the string value of this sequence.
    `Item` | `itemAt(int n)` Get the n'th item in the value, counting from 0
    `GroundedValue` | `reduce()` Reduce the sequence to its simplest form.
    `GroundedValue` | `subsequence(int start, int length)` Get a subsequence of the value

    - ### Methods inherited from interface net.sf.saxon.om.Sequence

      `head, iterate`

- - ### Method Detail

    - #### itemAt

          Item itemAt(int n)

      Get the n'th item in the value, counting from 0
      Parameters:
        `n` - the index of the required item, with 0 representing the first item in the sequence
      Returns:
        the n'th item if it exists, or null otherwise

    - #### subsequence

          GroundedValue subsequence(int start,
                                  int length)

      Get a subsequence of the value
      Parameters:
        `start` - the index of the first item to be included in the result, counting from zero. A negative value is taken as zero. If the value is beyond the end of the sequence, an empty sequence is returned
        `length` - the number of items to be included in the result. Specify Integer.MAX_VALUE to get the subsequence up to the end of the base sequence. If the value is negative, an empty sequence is returned. If the value goes off the end of the sequence, the result returns items up to the end of the sequence
      Returns:
        the required subsequence.

    - #### getLength

          int getLength()

      Get the size of the value (the number of items)
      Returns:
        the number of items in the sequence

    - #### effectiveBooleanValue

          boolean effectiveBooleanValue()
                                        throws XPathException

      Get the effective boolean value of this sequence
      Returns:
        the effective boolean value
      Throws:
        `XPathException` - if the sequence has no effective boolean value (for example a sequence of two integers)

    - #### getStringValue

          String getStringValue()
                                throws XPathException

      Get the string value of this sequence. The string value of an item is the result of applying the string() function. The string value of a sequence is the space-separated result of applying the string-join() function using a single space as the separator
      Returns:
        the string value of the sequence.
      Throws:
        `XPathException` - if the sequence contains items that have no string value (for example, function items)

    - #### getStringValueCS

          CharSequence getStringValueCS()
                                        throws XPathException

      Get the string value of this sequence. The string value of an item is the result of applying the string() function. The string value of a sequence is the space-separated result of applying the string-join() function using a single space as the separator
      Returns:
        the string value of the sequence.
      Throws:
        `XPathException` - if the sequence contains items that have no string value (for example, function items)

    - #### reduce

          GroundedValue reduce()

      Reduce the sequence to its simplest form. If the value is an empty sequence, the result will be EmptySequence.getInstance(). If the value is a single atomic value, the result will be an instance of AtomicValue. If the value is a single item of any other kind, the result will be an instance of SingletonItem. Otherwise, the result will typically be unchanged.
      Returns:
        the simplified sequence

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