Packages

  • package root
    Definition Classes
    root
  • package scala
    Definition Classes
    root
  • package xml

    This library provides support for the XML literal syntax in Scala programs.

    This library provides support for the XML literal syntax in Scala programs.

    val planets: scala.xml.Elem = <planets>
      <planet id="earth">
        <title>Earth</title>
        <mass unit="kg">5.9742e24</mass>
        <radius unit="m">6378.14e3</radius>
      </planet>
      <planet id="mars">
        <title>Mars</title>
        <mass unit="kg">0.64191e24</mass>
        <radius unit="m">3397.0e3</radius>
      </planet>
    </planets>

    Additionally, you can mix Scala expressions in your XML elements by using the curly brace notation:

    val sunMass = 1.99e30
    val sunRadius = 6.96e8
    val star = <star>
      <title>Sun</title>
      <mass unit="kg">{ sunMass }</mass>
      <radius unit="m">{ sunRadius }</radius>
      <surface unit="m²">{ 4 * Math.PI * Math.pow(sunRadius, 2) }</surface>
      <volume unit="m³">{ 4/3 * Math.PI * Math.pow(sunRadius, 3) }</volume>
    </star>

    An XML element, for example <star/> and <planet/>, is represented in this library as a case class, scala.xml.Elem.

    The sub-elements of XML values share a common base class, scala.xml.Node.

    However, the non-element declarations found in XML files share a different common base class, scala.xml.dtd.Decl. Additionally, document type declarations are represented by a different trait, scala.xml.dtd.DTD.

    For reading and writing XML data to and from files, see scala.xml.XML. The default parser of XML data is the Xerces parser and is provided in Java by javax.xml.parsers.SAXParser.

    A less greedy XML reader can return data as a sequential collection of events, see scala.xml.pull.XMLEventReader.

    For more control of the input, use the parser written in Scala that is provided, scala.xml.parsing.ConstructingParser.

    For working with XHTML input, use scala.xml.parsing.XhtmlParser.

    For more control of the output, use the scala.xml.PrettyPrinter.

    Utility methods for working with XML data are provided in scala.xml.Utility.

    XML values in Scala are immutable, but you can traverse and transform XML data with a scala.xml.transform.RuleTransformer.

    Definition Classes
    scala
  • package pull

    Classes needed to view an XML document as a series of events.

    Classes needed to view an XML document as a series of events. The document is parsed by an scala.xml.pull.XMLEventReader instance. You can treat it as an scala.collection.Iterator to retrieve the events, which are all subclasses of scala.xml.pull.XMLEvent.

    scala> val source = Source.fromString("""<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <?instruction custom value="customvalue"?>
    <!DOCTYPE foo [
      <!ENTITY bar "BAR">
    ]><foo>Hello<bar>&bar;</bar><bar>></bar></foo>""")
    
    source: scala.io.Source = non-empty iterator
    
    scala> val reader = new XMLEventReader(source)
    reader: scala.xml.pull.XMLEventReader = non-empty iterator
    
    scala> reader.foreach{ println(_) }
    EvProcInstr(instruction,custom value="customvalue")
    EvText(
    )
    EvElemStart(null,foo,,)
    EvText(Hello)
    EvComment( this is a comment )
    EvElemStart(null,bar,,)
    EvText(BAR)
    EvElemEnd(null,bar)
    EvElemStart(null,bar,,)
    EvEntityRef(gt)
    EvElemEnd(null,bar)
    EvElemEnd(null,foo)
    EvText(
    
    )
    Definition Classes
    xml
  • EvComment
  • EvElemEnd
  • EvElemStart
  • EvEntityRef
  • EvProcInstr
  • EvText
  • ProducerConsumerIterator
  • XMLEvent
  • XMLEventReader
t

scala.xml.pull

ProducerConsumerIterator

trait ProducerConsumerIterator[T >: Null] extends Iterator[T]

Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ProducerConsumerIterator
  2. Iterator
  3. IterableOnceOps
  4. IterableOnce
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Type Members

  1. class GroupedIterator[B >: A] extends AbstractIterator[collection.immutable.Seq[B]]
    Definition Classes
    Iterator

Abstract Value Members

  1. abstract val EndOfStream: T

Concrete Value Members

  1. final def ++[B >: T](xs: => collection.IterableOnce[B]): collection.Iterator[B]
    Definition Classes
    Iterator
    Annotations
    @inline()
  2. val MaxQueueSize: Int
  3. final def addString(b: collection.mutable.StringBuilder): collection.mutable.StringBuilder
    Definition Classes
    IterableOnceOps
    Annotations
    @inline()
  4. final def addString(b: collection.mutable.StringBuilder, sep: String): collection.mutable.StringBuilder
    Definition Classes
    IterableOnceOps
    Annotations
    @inline()
  5. def addString(b: collection.mutable.StringBuilder, start: String, sep: String, end: String): collection.mutable.StringBuilder
    Definition Classes
    IterableOnceOps
  6. def available(): Boolean
  7. def buffered: collection.BufferedIterator[T]
    Definition Classes
    Iterator
  8. def collect[B](pf: PartialFunction[T, B]): collection.Iterator[B]
    Definition Classes
    Iterator → IterableOnceOps
  9. def collectFirst[B](pf: PartialFunction[T, B]): Option[B]
    Definition Classes
    IterableOnceOps
  10. def concat[B >: T](xs: => collection.IterableOnce[B]): collection.Iterator[B]
    Definition Classes
    Iterator
  11. def contains(elem: Any): Boolean
    Definition Classes
    Iterator
  12. def copyToArray[B >: T](xs: Array[B], start: Int, len: Int): Int
    Definition Classes
    IterableOnceOps
  13. def copyToArray[B >: T](xs: Array[B], start: Int): Int
    Definition Classes
    IterableOnceOps
  14. def copyToArray[B >: T](xs: Array[B]): Int
    Definition Classes
    IterableOnceOps
  15. def corresponds[B](that: collection.IterableOnce[B])(p: (T, B) => Boolean): Boolean
    Definition Classes
    IterableOnceOps
  16. def count(p: (T) => Boolean): Int
    Definition Classes
    IterableOnceOps
  17. def distinct: collection.Iterator[T]
    Definition Classes
    Iterator
  18. def distinctBy[B](f: (T) => B): collection.Iterator[T]
    Definition Classes
    Iterator
  19. def drop(n: Int): collection.Iterator[T]
    Definition Classes
    Iterator → IterableOnceOps
  20. def dropWhile(p: (T) => Boolean): collection.Iterator[T]
    Definition Classes
    Iterator → IterableOnceOps
  21. def duplicate: (collection.Iterator[T], collection.Iterator[T])
    Definition Classes
    Iterator
  22. def exists(p: (T) => Boolean): Boolean
    Definition Classes
    IterableOnceOps
  23. def filter(p: (T) => Boolean): collection.Iterator[T]
    Definition Classes
    Iterator → IterableOnceOps
  24. def filterNot(p: (T) => Boolean): collection.Iterator[T]
    Definition Classes
    Iterator → IterableOnceOps
  25. def find(p: (T) => Boolean): Option[T]
    Definition Classes
    IterableOnceOps
  26. def flatMap[B](f: (T) => collection.IterableOnce[B]): collection.Iterator[B]
    Definition Classes
    Iterator → IterableOnceOps
  27. def flatten[B](implicit ev: (T) => collection.IterableOnce[B]): collection.Iterator[B]
    Definition Classes
    Iterator → IterableOnceOps
  28. def fold[A1 >: T](z: A1)(op: (A1, A1) => A1): A1
    Definition Classes
    IterableOnceOps
  29. def foldLeft[B](z: B)(op: (B, T) => B): B
    Definition Classes
    IterableOnceOps
  30. def foldRight[B](z: B)(op: (T, B) => B): B
    Definition Classes
    IterableOnceOps
  31. def forall(p: (T) => Boolean): Boolean
    Definition Classes
    IterableOnceOps
  32. def foreach[U](f: (T) => U): Unit
    Definition Classes
    IterableOnceOps
  33. def grouped[B >: T](size: Int): GroupedIterator[B]
    Definition Classes
    Iterator
  34. def hasNext: Boolean
    Definition Classes
    ProducerConsumerIterator → Iterator
  35. def indexOf[B >: T](elem: B, from: Int): Int
    Definition Classes
    Iterator
  36. def indexOf[B >: T](elem: B): Int
    Definition Classes
    Iterator
  37. def indexWhere(p: (T) => Boolean, from: Int): Int
    Definition Classes
    Iterator
  38. def interruptibly[A](body: => A): Option[A]
  39. def isEmpty: Boolean
    Definition Classes
    Iterator → IterableOnceOps
    Annotations
    @deprecatedOverriding("isEmpty is defined as !hasNext; override hasNext instead", "2.13.0")
  40. def isTraversableAgain: Boolean
    Definition Classes
    IterableOnceOps
  41. final def iterator: collection.Iterator[T]
    Definition Classes
    Iterator → IterableOnce
    Annotations
    @inline()
  42. def knownSize: Int
    Definition Classes
    IterableOnce
  43. final def length: Int
    Definition Classes
    Iterator
    Annotations
    @inline()
  44. def map[B](f: (T) => B): collection.Iterator[B]
    Definition Classes
    Iterator → IterableOnceOps
  45. def max[B >: T](implicit ord: math.Ordering[B]): T
    Definition Classes
    IterableOnceOps
  46. def maxBy[B](f: (T) => B)(implicit cmp: math.Ordering[B]): T
    Definition Classes
    IterableOnceOps
  47. def maxByOption[B](f: (T) => B)(implicit cmp: math.Ordering[B]): Option[T]
    Definition Classes
    IterableOnceOps
  48. def maxOption[B >: T](implicit ord: math.Ordering[B]): Option[T]
    Definition Classes
    IterableOnceOps
  49. def min[B >: T](implicit ord: math.Ordering[B]): T
    Definition Classes
    IterableOnceOps
  50. def minBy[B](f: (T) => B)(implicit cmp: math.Ordering[B]): T
    Definition Classes
    IterableOnceOps
  51. def minByOption[B](f: (T) => B)(implicit cmp: math.Ordering[B]): Option[T]
    Definition Classes
    IterableOnceOps
  52. def minOption[B >: T](implicit ord: math.Ordering[B]): Option[T]
    Definition Classes
    IterableOnceOps
  53. final def mkString: String
    Definition Classes
    IterableOnceOps
    Annotations
    @inline()
  54. final def mkString(sep: String): String
    Definition Classes
    IterableOnceOps
    Annotations
    @inline()
  55. final def mkString(start: String, sep: String, end: String): String
    Definition Classes
    IterableOnceOps
  56. def next(): T
    Definition Classes
    ProducerConsumerIterator → Iterator
  57. def nextOption(): Option[T]
    Definition Classes
    Iterator
  58. def nonEmpty: Boolean
    Definition Classes
    IterableOnceOps
    Annotations
    @deprecatedOverriding("nonEmpty is defined as !isEmpty; override isEmpty instead", "2.13.0")
  59. def padTo[B >: T](len: Int, elem: B): collection.Iterator[B]
    Definition Classes
    Iterator
  60. def partition(p: (T) => Boolean): (collection.Iterator[T], collection.Iterator[T])
    Definition Classes
    Iterator
  61. def patch[B >: T](from: Int, patchElems: collection.Iterator[B], replaced: Int): collection.Iterator[B]
    Definition Classes
    Iterator
  62. def produce(x: T): Unit
  63. def product[B >: T](implicit num: math.Numeric[B]): B
    Definition Classes
    IterableOnceOps
  64. def reduce[B >: T](op: (B, B) => B): B
    Definition Classes
    IterableOnceOps
  65. def reduceLeft[B >: T](op: (B, T) => B): B
    Definition Classes
    IterableOnceOps
  66. def reduceLeftOption[B >: T](op: (B, T) => B): Option[B]
    Definition Classes
    IterableOnceOps
  67. def reduceOption[B >: T](op: (B, B) => B): Option[B]
    Definition Classes
    IterableOnceOps
  68. def reduceRight[B >: T](op: (T, B) => B): B
    Definition Classes
    IterableOnceOps
  69. def reduceRightOption[B >: T](op: (T, B) => B): Option[B]
    Definition Classes
    IterableOnceOps
  70. def sameElements[B >: T](that: collection.IterableOnce[B]): Boolean
    Definition Classes
    Iterator
  71. def scanLeft[B](z: B)(op: (B, T) => B): collection.Iterator[B]
    Definition Classes
    Iterator → IterableOnceOps
  72. def size: Int
    Definition Classes
    IterableOnceOps
  73. def slice(from: Int, until: Int): collection.Iterator[T]
    Definition Classes
    Iterator → IterableOnceOps
  74. def sliding[B >: T](size: Int, step: Int): GroupedIterator[B]
    Definition Classes
    Iterator
  75. def span(p: (T) => Boolean): (collection.Iterator[T], collection.Iterator[T])
    Definition Classes
    Iterator → IterableOnceOps
  76. def splitAt(n: Int): (collection.Iterator[T], collection.Iterator[T])
    Definition Classes
    IterableOnceOps
  77. def stepper[S <: Stepper[_]](implicit shape: StepperShape[T, S]): S
    Definition Classes
    IterableOnce
  78. def sum[B >: T](implicit num: math.Numeric[B]): B
    Definition Classes
    IterableOnceOps
  79. def take(n: Int): collection.Iterator[T]
    Definition Classes
    Iterator → IterableOnceOps
  80. def takeWhile(p: (T) => Boolean): collection.Iterator[T]
    Definition Classes
    Iterator → IterableOnceOps
  81. def tapEach[U](f: (T) => U): collection.Iterator[T]
    Definition Classes
    Iterator → IterableOnceOps
  82. def to[C1](factory: Factory[T, C1]): C1
    Definition Classes
    IterableOnceOps
  83. def toArray[B >: T](implicit arg0: ClassTag[B]): Array[B]
    Definition Classes
    IterableOnceOps
  84. final def toBuffer[B >: T]: Buffer[B]
    Definition Classes
    IterableOnceOps
    Annotations
    @inline()
  85. def toIndexedSeq: collection.immutable.IndexedSeq[T]
    Definition Classes
    IterableOnceOps
  86. def toList: collection.immutable.List[T]
    Definition Classes
    IterableOnceOps
  87. def toMap[K, V](implicit ev: <:<[T, (K, V)]): Map[K, V]
    Definition Classes
    IterableOnceOps
  88. def toSeq: collection.immutable.Seq[T]
    Definition Classes
    IterableOnceOps
  89. def toSet[B >: T]: Set[B]
    Definition Classes
    IterableOnceOps
  90. def toString(): String
    Definition Classes
    Iterator → AnyRef → Any
  91. def toVector: collection.immutable.Vector[T]
    Definition Classes
    IterableOnceOps
  92. def withFilter(p: (T) => Boolean): collection.Iterator[T]
    Definition Classes
    Iterator
  93. def zip[B](that: collection.IterableOnce[B]): collection.Iterator[(T, B)]
    Definition Classes
    Iterator
  94. def zipAll[A1 >: T, B](that: collection.IterableOnce[B], thisElem: A1, thatElem: B): collection.Iterator[(A1, B)]
    Definition Classes
    Iterator
  95. def zipWithIndex: collection.Iterator[(T, Int)]
    Definition Classes
    Iterator → IterableOnceOps

Deprecated Value Members

  1. final def /:[B](z: B)(op: (B, T) => B): B
    Definition Classes
    IterableOnceOps
    Annotations
    @deprecated @inline()
    Deprecated

    (Since version 2.13.0) Use foldLeft instead of /:

  2. final def :\[B](z: B)(op: (T, B) => B): B
    Definition Classes
    IterableOnceOps
    Annotations
    @deprecated @inline()
    Deprecated

    (Since version 2.13.0) Use foldRight instead of :\

  3. def aggregate[B](z: => B)(seqop: (B, T) => B, combop: (B, B) => B): B
    Definition Classes
    IterableOnceOps
    Annotations
    @deprecated
    Deprecated

    (Since version 2.13.0) aggregate is not relevant for sequential collections. Use foldLeft(z)(seqop) instead.

  4. final def copyToBuffer[B >: T](dest: Buffer[B]): Unit
    Definition Classes
    IterableOnceOps
    Annotations
    @deprecated @inline()
    Deprecated

    (Since version 2.13.0) Use dest ++= coll instead

  5. final def hasDefiniteSize: Boolean
    Definition Classes
    Iterator → IterableOnceOps
    Annotations
    @deprecated @inline()
    Deprecated

    (Since version 2.13.0) hasDefiniteSize on Iterator is the same as isEmpty

  6. def scanRight[B](z: B)(op: (T, B) => B): collection.Iterator[B]
    Definition Classes
    Iterator
    Annotations
    @deprecated
    Deprecated

    (Since version 2.13.0) Call scanRight on an Iterable instead.

  7. def seq: ProducerConsumerIterator.this.type
    Definition Classes
    Iterator
    Annotations
    @deprecated
    Deprecated

    (Since version 2.13.0) Iterator.seq always returns the iterator itself

  8. final def toIterator: collection.Iterator[T]
    Definition Classes
    IterableOnceOps
    Annotations
    @deprecated @inline()
    Deprecated

    (Since version 2.13.0) Use .iterator instead of .toIterator

  9. final def toStream: collection.immutable.Stream[T]
    Definition Classes
    IterableOnceOps
    Annotations
    @deprecated @inline()
    Deprecated

    (Since version 2.13.0) Use .to(LazyList) instead of .toStream