scala.xml.pull

XMLEventReader

class XMLEventReader extends ProducerConsumerIterator[XMLEvent]

A pull parser that offers to view an XML document as a series of events. Example usage:

 import scala.xml.pull._
 import scala.io.Source

object reader { val src = Source.fromString("") val er = new XMLEventReader(src)

def main(args: Array[String]) { while (er.hasNext) Console.println(er.next) } }

Inherits

  1. ProducerConsumerIterator
  2. Iterator
  3. AnyRef
  4. Any

Type Members

  1. class GroupedIterator[B >: A] extends Iterator[Seq[B]]

    A flexible iterator for transforming an Iterator[A] into an Iterator[Seq[A]], with configurable sequence size, step, and strategy for dealing with elements which don't fit evenly

Value Members

  1. def ++(that: ⇒ Iterator[XMLEvent]): Iterator[XMLEvent]

    [use case] Concatenates this iterator with another

  2. def ++[B >: XMLEvent](that: ⇒ Iterator[B]): Iterator[B]

    Concatenates this iterator with another

  3. def /:[B](z: B)(op: (B, XMLEvent) ⇒ B): B

    Applies a binary operator to a start value and all values produced by this iterator, going left to right

  4. def :\[B](z: B)(op: (XMLEvent, B) ⇒ B): B

    Applies a binary operator to all values produced by this iterator and a start value, going right to left

  5. val EndOfStream: POISON

  6. val MaxQueueSize: Int

  7. def addString(buf: StringBuilder): StringBuilder

    Appends all values produced by this iterator to a string builder

  8. def addString(buf: StringBuilder, sep: String): StringBuilder

    Appends all values produced by this iterator to a string builder using a separator string

  9. def addString(buf: StringBuilder, start: String, sep: String, end: String): StringBuilder

    Appends all values produced by this iterator to a string builder using start, end, and separator strings

  10. def append[B >: XMLEvent](that: Iterator[B]): Iterator[B]

    Returns a new iterator that first yields the elements of this iterator followed by the elements provided by iterator that

  11. def available(): Boolean

  12. def buffered: BufferedIterator[XMLEvent]

    Creates a buffered iterator from this iterator

  13. def collect: Seq[XMLEvent]

    Collect elements into a seq

  14. def contains(elem: Any): Boolean

    Tests whether this iterator contains a given value as an element

  15. def copyToArray(xs: Array[XMLEvent], start: Int, len: Int): Unit

    [use case] Copies values produced by this iterator to an array

  16. def copyToArray[B >: XMLEvent](xs: Array[B]): Unit

    Copies values produced by this iterator to an array

  17. def copyToArray(xs: Array[XMLEvent], start: Int, len: Int): Unit

    [use case] Copies values produced by this iterator to an array

  18. def copyToArray[B >: XMLEvent](xs: Array[B], start: Int): Unit

    Copies values produced by this iterator to an array

  19. def copyToArray(xs: Array[XMLEvent], start: Int, len: Int): Unit

    [use case] Copies selected values produced by this iterator to an array

  20. def copyToArray[B >: XMLEvent](xs: Array[B], start: Int, len: Int): Unit

    Copies selected values produced by this iterator to an array

  21. def copyToBuffer[B >: XMLEvent](dest: Buffer[B]): Unit

    Copies all values produced by this iterator to a buffer

  22. def counted: CountedIterator[XMLEvent]

    Returns a counted iterator from this iterator

  23. def drop(n: Int): Iterator[XMLEvent]

    Advances this iterator past the first n elements, or the length of the iterator, whichever is smaller

  24. def dropWhile(p: (XMLEvent) ⇒ Boolean): Iterator[XMLEvent]

    Skips longest sequence of elements of this iterator which satisfy given predicate p, and returns an iterator of the remaining elements

  25. def duplicate: (Iterator[XMLEvent], Iterator[XMLEvent])

    Creates two new iterators that both iterate over the same elements as this iterator (in the same order)

  26. def equals(arg0: Any): Boolean

    This method is used to compare the receiver object (this) with the argument object (arg0) for equivalence

  27. def exists(p: (XMLEvent) ⇒ Boolean): Boolean

    Tests whether a predicate holds for some of the values produced by this iterator

  28. def filter(p: (XMLEvent) ⇒ Boolean): Iterator[XMLEvent]

    Returns an iterator over all the elements of this iterator that satisfy the predicate p

  29. def filterNot(p: (XMLEvent) ⇒ Boolean): Iterator[XMLEvent]

    Creates an iterator over all the elements of this iterator which do not satisfy a predicate p

  30. def find(p: (XMLEvent) ⇒ Boolean): Option[XMLEvent]

    Finds the first value produced by the iterator satisfying a predicate, if any

  31. def findIndexOf(p: (XMLEvent) ⇒ Boolean): Int

    Returns index of the first element satisfying a predicate, or -1

  32. def flatMap[B](f: (XMLEvent) ⇒ Iterator[B]): Iterator[B]

    Creates a new iterator by applying a function to all values produced by this iterator and concatenating the results

  33. def foldLeft[B](z: B)(op: (B, XMLEvent) ⇒ B): B

    Applies a binary operator to a start value and all values produced by this iterator, going left to right

  34. def foldRight[B](z: B)(op: (XMLEvent, B) ⇒ B): B

    Applies a binary operator to all values produced by this iterator and a start value, going right to left

  35. def forall(p: (XMLEvent) ⇒ Boolean): Boolean

    Tests whether a predicate holds for all values produced by this iterator

  36. def foreach(f: (XMLEvent) ⇒ Unit): Unit

    [use case] Applies a function f to all values produced by this iterator

  37. def foreach[U](f: (XMLEvent) ⇒ U): Unit

    Applies a function f to all values produced by this iterator

  38. def grouped[B >: XMLEvent](size: Int): GroupedIterator[B]

    Returns an iterator which groups this iterator into fixed size blocks

  39. def hasNext(): Boolean

    Tests whether this iterator can provide another element

  40. def hashCode(): Int

    Returns a hash code value for the object

  41. def indexOf[B >: XMLEvent](elem: B): Int

    Returns the index of the first occurence of the specified object in this iterable object

  42. def indexWhere(p: (XMLEvent) ⇒ Boolean): Int

    Returns the index of the first produced value satisfying a predicate, or -1

  43. def interruptibly[T](body: ⇒ T): Option[T]

  44. def length: Int

    Returns the number of elements in this iterator

  45. def map[B](f: (XMLEvent) ⇒ B): Iterator[B]

    Creates a new iterator that maps all produced values of this iterator to new values using a transformation function

  46. def mkString: String

    Displays all values produced by this iterator in a string

  47. def mkString(sep: String): String

    Displays all values produced by this iterator in a string using a separator string

  48. def mkString(start: String, sep: String, end: String): String

    Displays all values produced by this iterator in a string using start, end, and separator strings

  49. def next(): XMLEvent

    Produces the next element of this iterator

  50. def padTo(len: Int, elem: XMLEvent): Iterator[XMLEvent]

    [use case] Appends an element value to this iterator until a given target length is reached

  51. def padTo[A1 >: XMLEvent](len: Int, elem: A1): Iterator[A1]

    Appends an element value to this iterator until a given target length is reached

  52. def partialMap[B](pf: PartialFunction[XMLEvent, B]): Iterator[B]

    Creates an iterator by transforming values produced by this iterator with a partial function, dropping those values for which the partial function is not defined

  53. def partition(p: (XMLEvent) ⇒ Boolean): (Iterator[XMLEvent], Iterator[XMLEvent])

    Partitions this iterator in two iterators according to a predicate

  54. def patch[B >: XMLEvent](from: Int, patchElems: Iterator[B], replaced: Int): Iterator[B]

    Returns this iterator with patched values

  55. val preserveWS: Boolean

  56. def produce(x: XMLEvent): Unit

  57. def readInto[B >: XMLEvent](xs: Array[B]): Unit

  58. def readInto[B >: XMLEvent](xs: Array[B], start: Int): Unit

  59. def readInto[B >: XMLEvent](xs: Array[B], start: Int, sz: Int): Unit

    Fills the given array xs with the elements of this sequence starting at position start

  60. def reduceLeft[B >: XMLEvent](op: (B, XMLEvent) ⇒ B): B

    Applies a binary operator to all values produced by this iterator, going left to right

  61. def reduceLeftOption[B >: XMLEvent](op: (B, XMLEvent) ⇒ B): Option[B]

    Optionally applies a binary operator to all values produced by this iterator, going left to right

  62. def reduceRight[B >: XMLEvent](op: (XMLEvent, B) ⇒ B): B

    Applies a binary operator to all values produced by this iterator, going right to left

  63. def reduceRightOption[B >: XMLEvent](op: (XMLEvent, B) ⇒ B): Option[B]

    Optionally applies a binary operator to all values produced by this iterator, going right to left

  64. def sameElements(that: Iterator[_]): Boolean

    Tests if another iterator produces the same valeus as this one

  65. def slice(from: Int, until: Int): Iterator[XMLEvent]

    Creates an iterator returning an interval of the values produced by this iterator

  66. def sliding[B >: XMLEvent](size: Int, step: Int): GroupedIterator[B]

    Returns an iterator which presents a "sliding window" view of another iterator

  67. def stop: Unit

  68. def take(n: Int): Iterator[XMLEvent]

    Selects first n values of this iterator

  69. def takeWhile(p: (XMLEvent) ⇒ Boolean): Iterator[XMLEvent]

    Takes longest prefix of values produced by this iterator that satisfy a predicate

  70. def toList: List[XMLEvent]

    Traverses this iterator and returns all produced values in a list

  71. def toSeq: Seq[XMLEvent]

    Traverses this iterator and returns all produced values in a sequence

  72. def toStream: Stream[XMLEvent]

    Lazily wraps a Stream around this iterator so its values are memoized

  73. def toString(): String

    Converts this iterator to a string

  74. def withFilter(p: (XMLEvent) ⇒ Boolean): Iterator[XMLEvent]

    Creates an iterator over all the elements of this iterator that satisfy the predicate p

  75. def zip[B](that: Iterator[B]): Iterator[(XMLEvent, B)]

    Creates an iterator formed from this iterator and another iterator by combining corresponding values in pairs

  76. def zipAll[B](that: Iterator[B], thisElem: XMLEvent, thatElem: B): Iterator[(XMLEvent, B)]

    [use case] Creates an iterator formed from this iterator and another iterator by combining corresponding elements in pairs

  77. def zipAll[B, A1 >: XMLEvent, B1 >: B](that: Iterator[B], thisElem: A1, thatElem: B1): Iterator[(A1, B1)]

    Creates an iterator formed from this iterator and another iterator by combining corresponding elements in pairs

  78. def zipWithIndex: Iterator[(XMLEvent, Int)] {...}

    Creates an iterator that pairs each element produced by this iterator with its index, counting from 0

Instance constructors

  1. new XMLEventReader(src: Source)

  2. new XMLEventReader()