net.sf.saxon.value
Class EmptySequence

java.lang.Object
  extended by net.sf.saxon.value.Value
      extended by net.sf.saxon.value.EmptySequence
All Implemented Interfaces:
Serializable, Comparable, SequenceIterable, ValueRepresentation

public final class EmptySequence
extends Value

An EmptySequence object represents a sequence containing no members.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class net.sf.saxon.value.Value
EMPTY_CLASS_ARRAY, INDETERMINATE_ORDERING
 
Fields inherited from interface net.sf.saxon.om.ValueRepresentation
EMPTY_VALUE_ARRAY
 
Method Summary
 Item asItem()
          Return the value in the form of an Item
 boolean effectiveBooleanValue()
          Get the effective boolean value - always false
 boolean equals(Object other)
          Is this expression the same as another expression?
 int getCardinality()
          Determine the static cardinality
static EmptySequence getInstance()
          Get the implicit instance of this class
 ItemType getItemType(TypeHierarchy th)
          Determine the item type
 int getLength()
          Get the length of the sequence
 int hashCode()
          Return a hash code to support the equals() function
 boolean isMultiValued()
          Determine whether the value is multivalued, that is, whether it is a sequence that potentially contains more than one item
 SequenceIterator iterate()
          Return an iteration over the sequence
 
Methods inherited from class net.sf.saxon.value.Value
asItem, asIterator, asValue, checkPermittedContents, compareTo, convert, convertJavaObjectToXPath, convertToJava, fromItem, getCanonicalLexicalRepresentation, getIterator, getSchemaComparable, getStringValue, getStringValueCS, itemAt, iterate, makeQNameValue, process, reduce, stringToNumber, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

getInstance

public static EmptySequence getInstance()
Get the implicit instance of this class


isMultiValued

public boolean isMultiValued()
Determine whether the value is multivalued, that is, whether it is a sequence that potentially contains more than one item

Specified by:
isMultiValued in class Value
Returns:
true if the value might contain more than one item, false if it definitely contains zero or one items

iterate

public SequenceIterator iterate()
Return an iteration over the sequence

Specified by:
iterate in class Value
Returns:
an iterator over the sequence of items

asItem

public Item asItem()
Return the value in the form of an Item

Overrides:
asItem in class Value
Returns:
the value in the form of an Item

getItemType

public ItemType getItemType(TypeHierarchy th)
Determine the item type

Overrides:
getItemType in class Value
Parameters:
th -
Returns:
for the default implementation: AnyItemType (not known)

getCardinality

public int getCardinality()
Determine the static cardinality

Overrides:
getCardinality in class Value

getLength

public final int getLength()
Get the length of the sequence

Overrides:
getLength in class Value
Returns:
always 0 for an empty sequence

equals

public boolean equals(Object other)
Is this expression the same as another expression?

Overrides:
equals in class Value
Throws:
ClassCastException - if the values are not comparable

hashCode

public int hashCode()
Description copied from class: Value
Return a hash code to support the equals() function

Overrides:
hashCode in class Value

effectiveBooleanValue

public boolean effectiveBooleanValue()
Get the effective boolean value - always false

Overrides:
effectiveBooleanValue in class Value
Returns:
the effective boolean value


Copyright (C) Michael H. Kay. All rights reserved.