blob: 91ddba6ce6c8c97370ca3c13be5c4dd341478655 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
|
/* __ *\
** ________ ___ / / ___ Scala API **
** / __/ __// _ | / / / _ | (c) 2003-2010, LAMP/EPFL **
** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
// $Id$
package scala.xml
import collection.Seq
/** A hack to group XML nodes in one node for output.
*
* @author Burak Emir
* @version 1.0
*/
@serializable
case class Group(val nodes: Seq[Node]) extends Node {
// final override def doTransform = false
override def theSeq = nodes
/** XXX this is ridiculous, we can't do equality like this. */
override def equals(x: Any) = x match {
case z:Group => (length == z.length) && sameElements(z)
case z:Node => (length == 1) && z == apply(0)
case z:Seq[_] => sameElements(z)
case z:String => text == z
case _ => false
}
/* As if there were a hashCode which could back up the above implementation! */
override def hashCode = nodes.hashCode
/**
* @throws Predef.UnsupportedOperationException (always)
*/
final def label =
throw new UnsupportedOperationException("class Group does not support method 'label'")
/**
* @throws Predef.UnsupportedOperationException (always)
*/
final override def attributes =
throw new UnsupportedOperationException("class Group does not support method 'attributes'")
/**
* @throws Predef.UnsupportedOperationException (always)
*/
final override def namespace =
throw new UnsupportedOperationException("class Group does not support method 'namespace'")
/**
* @throws Predef.UnsupportedOperationException (always)
*/
final override def child =
throw new UnsupportedOperationException("class Group does not support method 'child'")
/**
* @throws Predef.UnsupportedOperationException (always)
*/
def buildString(sb: StringBuilder) =
throw new UnsupportedOperationException(
"class Group does not support method toString(StringBuilder)")
}
|