## org.exist.xquery.value
Class StringValue

    java.lang.Object
      org.exist.xquery.value.AtomicValue
          org.exist.xquery.value.StringValue

All Implemented Interfaces:
  java.lang.Comparable, Indexable, Item, Sequence

public class StringValue
extends AtomicValue

Field Summary
`static StringValue` `EMPTY_STRING`

Fields inherited from class org.exist.xquery.value.AtomicValue
`EMPTY_VALUE`

Fields inherited from interface org.exist.xquery.value.Sequence
`EMPTY_SEQUENCE`

Constructor Summary
`StringValue(java.lang.String stringValue)`
`StringValue(java.lang.String stringValue, int type)`

Method Summary
`static java.lang.String` `collapseWhitespace(java.lang.CharSequence in)` Collapses all sequences of adjacent whitespace chars in the input string into a single space.
`int` `compareTo(java.text.Collator collator, AtomicValue other)`
`boolean` `compareTo(java.text.Collator collator, int operator, AtomicValue other)`
`int` `compareTo(java.lang.Object o)`
`boolean` `contains(java.text.Collator collator, AtomicValue other)` Compares this atomic value to another.
`int` `conversionPreference(java.lang.Class javaClass)` Returns a preference indicator, indicating the preference of a value to be converted into the given Java class.
`AtomicValue` `convertTo(int requiredType)` Convert this item into an atomic value, whose type corresponds to the specified target type.
`boolean` `effectiveBooleanValue()` Get the effective boolean value of this sequence.
`boolean` `endsWith(java.text.Collator collator, AtomicValue other)` Compares this atomic value to another.
`StringValue` `expand()`
`static java.lang.String` `expand(java.lang.CharSequence seq)`
`java.lang.String` `getStringValue()` Return the string value of this item (see the definition of string value in XPath).
`int` `getType()` Return the type of this item according to the type constants defined in class `Type`.
`Item` `itemAt(int pos)` Returns the item located at the specified position within this sequence.
`AtomicValue` `max(java.text.Collator collator, AtomicValue other)`
`AtomicValue` `min(java.text.Collator collator, AtomicValue other)`
`static java.lang.String` `normalizeWhitespace(java.lang.CharSequence seq)`
`byte[]` `serializeValue(int offset, boolean caseSensitive)` Serialize for the persistant storage
`boolean` `startsWith(java.text.Collator collator, AtomicValue other)` Compares this atomic value to another.
`java.lang.Object` `toJavaObject(java.lang.Class target)` Convert the value into an instance of the specified Java class.
`java.lang.String` `toString()`
`static java.lang.String` `trimWhitespace(java.lang.String in)`

Methods inherited from class org.exist.xquery.value.AtomicValue
`add, addAll, atomize, clearContext, copyTo, deserialize, dump, getCardinality, getDocumentSet, getItemType, getLength, hasMany, hasOne, isCached, isEmpty, isPersistentSet, iterate, promote, removeDuplicates, serialize, setIsCached, setSelfAsContext, toNodeSet, toSAX, toSequence, unorderedIterator`

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

Field Detail

### EMPTY_STRING

    public static final StringValue EMPTY_STRING

Constructor Detail

### StringValue

    public StringValue(java.lang.String stringValue,
                       int type)
                throws XPathException

### StringValue

    public StringValue(java.lang.String stringValue)

Method Detail

### expand

    public StringValue expand()
                       throws XPathException

  Throws:
    `XPathException`

### getType

    public int getType()

  Description copied from interface: `Item`
  Return the type of this item according to the type constants defined in class `Type`.

  Specified by:
    `getType` in interface `Item`
  Overrides:
    `getType` in class `AtomicValue`

### getStringValue

    public java.lang.String getStringValue()

  Description copied from interface: `Item`
  Return the string value of this item (see the definition of string value in XPath).

  Specified by:
    `getStringValue` in interface `Item`
  Specified by:
    `getStringValue` in class `AtomicValue`

### itemAt

    public Item itemAt(int pos)

  Description copied from interface: `Sequence`
  Returns the item located at the specified position within this sequence. Items are counted beginning at 0.

  Specified by:
    `itemAt` in interface `Sequence`
  Overrides:
    `itemAt` in class `AtomicValue`

### convertTo

    public AtomicValue convertTo(int requiredType)
                          throws XPathException

  Description copied from interface: `Item`
  Convert this item into an atomic value, whose type corresponds to the specified target type. requiredType should be one of the type constants defined in `Type`. An `XPathException` is thrown if the conversion is impossible.

  Specified by:
    `convertTo` in interface `Item`
  Specified by:
    `convertTo` in class `AtomicValue`
  Throws:
    `XPathException`

### conversionPreference

    public int conversionPreference(java.lang.Class javaClass)

  Description copied from interface: `Sequence`
  Returns a preference indicator, indicating the preference of a value to be converted into the given Java class. Low numbers mean that the value can be easily converted into the given class.

  Specified by:
    `conversionPreference` in interface `Item`
  Overrides:
    `conversionPreference` in class `AtomicValue`

### toJavaObject

    public java.lang.Object toJavaObject(java.lang.Class target)
                                  throws XPathException

  Description copied from interface: `Sequence`
  Convert the value into an instance of the specified Java class.

  Specified by:
    `toJavaObject` in interface `Item`
  Overrides:
    `toJavaObject` in class `AtomicValue`
  Throws:
    `XPathException`

### compareTo

    public boolean compareTo(java.text.Collator collator,
                             int operator,
                             AtomicValue other)
                      throws XPathException

  Specified by:
    `compareTo` in class `AtomicValue`
  Throws:
    `XPathException`

### compareTo

    public int compareTo(java.text.Collator collator,
                         AtomicValue other)
                  throws XPathException

  Specified by:
    `compareTo` in class `AtomicValue`
  Throws:
    `XPathException`

### startsWith

    public boolean startsWith(java.text.Collator collator,
                              AtomicValue other)
                       throws XPathException

  Description copied from class: `AtomicValue`
  Compares this atomic value to another. Returns true if the current value is of type string and its value starts with the string value of the other value.

  Overrides:
    `startsWith` in class `AtomicValue`
  Parameters:
    `collator` - Collator used for string comparison.
    `other` -
  Throws:
    `XPathException` - if this is not a string.

### endsWith

    public boolean endsWith(java.text.Collator collator,
                            AtomicValue other)
                     throws XPathException

  Description copied from class: `AtomicValue`
  Compares this atomic value to another. Returns true if the current value is of type string and its value ends with the string value of the other value.

  Overrides:
    `endsWith` in class `AtomicValue`
  Parameters:
    `collator` - Collator used for string comparison.
    `other` -
  Throws:
    `XPathException` - if this is not a string.

### contains

    public boolean contains(java.text.Collator collator,
                            AtomicValue other)
                     throws XPathException

  Description copied from class: `AtomicValue`
  Compares this atomic value to another. Returns true if the current value is of type string and its value contains the string value of the other value.

  Overrides:
    `contains` in class `AtomicValue`
  Parameters:
    `collator` - Collator used for string comparison.
    `other` -
  Throws:
    `XPathException` - if this is not a string.

### effectiveBooleanValue

    public boolean effectiveBooleanValue()
                                  throws XPathException

  Description copied from interface: `Sequence`
  Get the effective boolean value of this sequence. Will be false if the sequence is empty, true otherwise.

  Specified by:
    `effectiveBooleanValue` in interface `Sequence`
  Overrides:
    `effectiveBooleanValue` in class `AtomicValue`
  Throws:
    `XPathException`

### toString

    public java.lang.String toString()

  Overrides:
    `toString` in class `AtomicValue`

### normalizeWhitespace

    public static final java.lang.String normalizeWhitespace(java.lang.CharSequence seq)

### collapseWhitespace

    public static java.lang.String collapseWhitespace(java.lang.CharSequence in)

  Collapses all sequences of adjacent whitespace chars in the input string into a single space.

  Parameters:
    `in` -

### trimWhitespace

    public static final java.lang.String trimWhitespace(java.lang.String in)

### expand

    public static final java.lang.String expand(java.lang.CharSequence seq)
                                         throws XPathException

  Throws:
    `XPathException`

### max

    public AtomicValue max(java.text.Collator collator,
                           AtomicValue other)
                    throws XPathException

  Specified by:
    `max` in class `AtomicValue`
  Throws:
    `XPathException`

### min

    public AtomicValue min(java.text.Collator collator,
                           AtomicValue other)
                    throws XPathException

  Specified by:
    `min` in class `AtomicValue`
  Throws:
    `XPathException`

### compareTo

    public int compareTo(java.lang.Object o)

  Specified by:
    `compareTo` in interface `java.lang.Comparable`
  Overrides:
    `compareTo` in class `AtomicValue`

### serializeValue

    public byte[] serializeValue(int offset,
                                 boolean caseSensitive)

  Serialize for the persistant storage

  Specified by:
    `serializeValue` in interface `Indexable`
  Overrides:
    `serializeValue` in class `AtomicValue`
  Parameters:
    `offset` -

Copyright (C) Wolfgang Meier. All rights reserved.