class
Attributes
extends Map[QName, String] with MapLike[QName, String, Attributes]
Instance Constructors
-
new
Attributes
(delegate: Map[QName, String])
Value Members
-
def
!=
(arg0: AnyRef): Boolean
-
def
!=
(arg0: Any): Boolean
-
def
##
(): Int
-
-
def
+
(kv: (QName, String))(implicit d: DummyImplicit): Attributes
-
def
+
[B >: String]
(kv: (QName, B)): Map[QName, B]
-
def
+
[B1 >: String]
(elem1: (QName, B1), elem2: (QName, B1), elems: (QName, B1)*): Map[QName, B1]
-
def
++
[B1 >: String]
(xs: TraversableOnce[(QName, B1)]): Map[QName, B1]
-
def
++
[B1 >: String]
(xs: GenTraversableOnce[(QName, B1)]): Map[QName, B1]
-
def
++
[B >: (QName, String), That]
(that: TraversableOnce[B])(implicit bf: CanBuildFrom[Attributes, B, That]): That
-
def
++
[B >: (QName, String), That]
(that: GenTraversableOnce[B])(implicit bf: CanBuildFrom[Attributes, B, That]): That
-
def
++:
[B >: (QName, String), That]
(that: Traversable[B])(implicit bf: CanBuildFrom[Attributes, B, That]): That
-
def
++:
[B >: (QName, String), That]
(that: TraversableOnce[B])(implicit bf: CanBuildFrom[Attributes, B, That]): That
-
-
-
def
--
(xs: TraversableOnce[QName]): Attributes
-
def
--
(xs: GenTraversableOnce[QName]): Attributes
-
def
/:
[B]
(z: B)(op: (B, (QName, String)) ⇒ B): B
-
def
/:\
[A1 >: (QName, String)]
(z: A1)(op: (A1, A1) ⇒ A1): A1
-
def
:\
[B]
(z: B)(op: ((QName, String), B) ⇒ B): B
-
def
==
(arg0: AnyRef): Boolean
-
def
==
(arg0: Any): Boolean
-
def
addString
(b: StringBuilder, start: String, sep: String, end: String): StringBuilder
-
def
addString
(b: StringBuilder): StringBuilder
-
def
addString
(b: StringBuilder, sep: String): StringBuilder
-
def
aggregate
[B]
(z: B)(seqop: (B, (QName, String)) ⇒ B, combop: (B, B) ⇒ B): B
-
def
andThen
[C]
(k: (String) ⇒ C): PartialFunction[QName, C]
-
def
apply
(key: QName): String
-
def
asInstanceOf
[T0]
: T0
-
def
canEqual
(that: Any): Boolean
-
def
clone
(): AnyRef
-
def
collect
[B, That]
(pf: PartialFunction[(QName, String), B])(implicit bf: CanBuildFrom[Attributes, B, That]): That
-
def
collectFirst
[B]
(pf: PartialFunction[(QName, String), B]): Option[B]
-
def
companion
: GenericCompanion[Iterable]
-
def
compose
[A]
(g: (A) ⇒ QName): (A) ⇒ String
-
def
contains
(key: QName): Boolean
-
def
copyToArray
[B >: (QName, String)]
(xs: Array[B], start: Int, len: Int): Unit
-
def
copyToArray
[B >: (QName, String)]
(xs: Array[B]): Unit
-
def
copyToArray
[B >: (QName, String)]
(xs: Array[B], start: Int): Unit
-
def
copyToBuffer
[B >: (QName, String)]
(dest: Buffer[B]): Unit
-
def
count
(p: ((QName, String)) ⇒ Boolean): Int
-
def
default
(key: QName): String
-
-
def
dropRight
(n: Int): Attributes
-
def
dropWhile
(p: ((QName, String)) ⇒ Boolean): Attributes
-
-
def
eq
(arg0: AnyRef): Boolean
-
def
equals
(that: Any): Boolean
-
def
exists
(p: ((QName, String)) ⇒ Boolean): Boolean
-
def
filter
(p: ((QName, String)) ⇒ Boolean): Attributes
-
def
filterKeys
(p: (QName) ⇒ Boolean): Map[QName, String]
-
def
filterNot
(p: ((QName, String)) ⇒ Boolean): Attributes
-
def
finalize
(): Unit
-
def
find
(p: ((QName, String)) ⇒ Boolean): Option[(QName, String)]
-
def
flatMap
[B, That]
(f: ((QName, String)) ⇒ GenTraversableOnce[B])(implicit bf: CanBuildFrom[Attributes, B, That]): That
-
def
flatten
[B]
(implicit asTraversable: ((QName, String)) ⇒ TraversableOnce[B]): Traversable[B]
-
def
fold
[A1 >: (QName, String)]
(z: A1)(op: (A1, A1) ⇒ A1): A1
-
def
foldLeft
[B]
(z: B)(op: (B, (QName, String)) ⇒ B): B
-
def
foldRight
[B]
(z: B)(op: ((QName, String), B) ⇒ B): B
-
def
forall
(p: ((QName, String)) ⇒ Boolean): Boolean
-
def
foreach
[U]
(f: ((QName, String)) ⇒ U): Unit
-
def
genericBuilder
[B]
: Builder[B, Iterable[B]]
-
def
get
(key: QName): Option[String]
-
def
getClass
(): java.lang.Class[_]
-
def
getOrElse
[B1 >: String]
(key: QName, default: ⇒ B1): B1
-
def
groupBy
[K]
(f: ((QName, String)) ⇒ K): Map[K, Attributes]
-
def
grouped
(size: Int): Iterator[Attributes]
-
def
hasDefiniteSize
: Boolean
-
def
hashCode
(): Int
-
def
head
: (QName, String)
-
def
headOption
: Option[(QName, String)]
-
-
def
inits
: Iterator[Attributes]
-
def
isDefinedAt
(key: QName): Boolean
-
def
isEmpty
: Boolean
-
def
isInstanceOf
[T0]
: Boolean
-
def
isTraversableAgain
: Boolean
-
def
iterator
: Iterator[(QName, String)]
-
def
keySet
: Set[QName]
-
def
keys
: Iterable[QName]
-
def
keysIterator
: Iterator[QName]
-
def
last
: (QName, String)
-
def
lastOption
: Option[(QName, String)]
-
def
lift
: (QName) ⇒ Option[String]
-
def
map
[B, That]
(f: ((QName, String)) ⇒ B)(implicit bf: CanBuildFrom[Attributes, B, That]): That
-
def
mapValues
[C]
(f: (String) ⇒ C): Map[QName, C]
-
def
max
[B >: (QName, String)]
(implicit cmp: Ordering[B]): (QName, String)
-
def
maxBy
[B]
(f: ((QName, String)) ⇒ B)(implicit cmp: Ordering[B]): (QName, String)
-
def
min
[B >: (QName, String)]
(implicit cmp: Ordering[B]): (QName, String)
-
def
minBy
[B]
(f: ((QName, String)) ⇒ B)(implicit cmp: Ordering[B]): (QName, String)
-
def
mkString
: String
-
def
mkString
(sep: String): String
-
def
mkString
(start: String, sep: String, end: String): String
-
def
ne
(arg0: AnyRef): Boolean
-
def
newBuilder
: Builder[(QName, String), Attributes]
-
def
nonEmpty
: Boolean
-
def
notify
(): Unit
-
def
notifyAll
(): Unit
-
def
orElse
[A1 <: QName, B1 >: String]
(that: PartialFunction[A1, B1]): PartialFunction[A1, B1]
-
def
par
: ParMap[QName, String]
-
def
parCombiner
: Combiner[(QName, String), ParMap[QName, String]]
-
-
def
product
[B >: (QName, String)]
(implicit num: Numeric[B]): B
-
def
reduce
[A1 >: (QName, String)]
(op: (A1, A1) ⇒ A1): A1
-
def
reduceLeft
[B >: (QName, String)]
(op: (B, (QName, String)) ⇒ B): B
-
def
reduceLeftOption
[B >: (QName, String)]
(op: (B, (QName, String)) ⇒ B): Option[B]
-
def
reduceOption
[A1 >: (QName, String)]
(op: (A1, A1) ⇒ A1): Option[A1]
-
def
reduceRight
[B >: (QName, String)]
(op: ((QName, String), B) ⇒ B): B
-
def
reduceRightOption
[B >: (QName, String)]
(op: ((QName, String), B) ⇒ B): Option[B]
-
-
def
reversed
: List[(QName, String)]
-
def
sameElements
[B >: (QName, String)]
(that: Iterable[B]): Boolean
-
def
sameElements
[B >: (QName, String)]
(that: GenIterable[B]): Boolean
-
def
scan
[B >: (QName, String), That]
(z: B)(op: (B, B) ⇒ B)(implicit cbf: CanBuildFrom[Attributes, B, That]): That
-
def
scanLeft
[B, That]
(z: B)(op: (B, (QName, String)) ⇒ B)(implicit bf: CanBuildFrom[Attributes, B, That]): That
-
def
scanRight
[B, That]
(z: B)(op: ((QName, String), B) ⇒ B)(implicit bf: CanBuildFrom[Attributes, B, That]): That
-
def
seq
: Map[QName, String]
-
def
size
: Int
-
def
slice
(from: Int, until: Int): Attributes
-
def
sliding
[B >: (QName, String)]
(size: Int, step: Int): Iterator[Attributes]
-
def
sliding
[B >: (QName, String)]
(size: Int): Iterator[Attributes]
-
-
-
def
stringPrefix
: String
-
def
sum
[B >: (QName, String)]
(implicit num: Numeric[B]): B
-
def
synchronized
[T0]
(arg0: ⇒ T0): T0
-
-
def
tails
: Iterator[Attributes]
-
-
def
takeRight
(n: Int): Attributes
-
def
takeWhile
(p: ((QName, String)) ⇒ Boolean): Attributes
-
def
thisCollection
: Iterable[(QName, String)]
-
def
toArray
[B >: (QName, String)]
(implicit arg0: ClassManifest[B]): Array[B]
-
def
toBuffer
[C >: (QName, String)]
: Buffer[C]
-
def
toCollection
(repr: Attributes): Iterable[(QName, String)]
-
def
toIndexedSeq
[B >: (QName, String)]
: IndexedSeq[B]
-
def
toIterable
: Iterable[(QName, String)]
-
def
toIterator
: Iterator[(QName, String)]
-
def
toList
: List[(QName, String)]
-
def
toMap
[T, U]
(implicit ev: <:<[(QName, String), (T, U)]): Map[T, U]
-
def
toSeq
: Seq[(QName, String)]
-
def
toSet
[B >: (QName, String)]
: Set[B]
-
def
toStream
: Stream[(QName, String)]
-
def
toString
(): String
-
def
toTraversable
: Traversable[(QName, String)]
-
def
transform
[C, That]
(f: (QName, String) ⇒ C)(implicit bf: CanBuildFrom[Attributes, (QName, C), That]): That
-
def
transpose
[B]
(implicit asTraversable: ((QName, String)) ⇒ TraversableOnce[B]): Traversable[Traversable[B]]
-
def
unzip
[A1, A2]
(implicit asPair: ((QName, String)) ⇒ (A1, A2)): (Iterable[A1], Iterable[A2])
-
def
unzip3
[A1, A2, A3]
(implicit asTriple: ((QName, String)) ⇒ (A1, A2, A3)): (Iterable[A1], Iterable[A2], Iterable[A3])
-
def
updated
[B1 >: String]
(key: QName, value: B1): Map[QName, B1]
-
def
values
: Iterable[String]
-
def
valuesIterator
: Iterator[String]
-
def
view
(from: Int, until: Int): IterableView[(QName, String), Attributes]
-
def
view
: IterableView[(QName, String), Attributes]
-
def
wait
(): Unit
-
def
wait
(arg0: Long, arg1: Int): Unit
-
def
wait
(arg0: Long): Unit
-
def
withDefault
[B1 >: String]
(d: (QName) ⇒ B1): Map[QName, B1]
-
def
withDefaultValue
[B1 >: String]
(d: B1): Map[QName, B1]
-
def
withFilter
(p: ((QName, String)) ⇒ Boolean): FilterMonadic[(QName, String), Attributes]
-
def
zip
[A1 >: (QName, String), B, That]
(that: Iterable[B])(implicit bf: CanBuildFrom[Attributes, (A1, B), That]): That
-
def
zip
[A1 >: (QName, String), B, That]
(that: GenIterable[B])(implicit bf: CanBuildFrom[Attributes, (A1, B), That]): That
-
def
zipAll
[B, A1 >: (QName, String), That]
(that: Iterable[B], thisElem: A1, thatElem: B)(implicit bf: CanBuildFrom[Attributes, (A1, B), That]): That
-
def
zipAll
[B, A1 >: (QName, String), That]
(that: GenIterable[B], thisElem: A1, thatElem: B)(implicit bf: CanBuildFrom[Attributes, (A1, B), That]): That
-
def
zipWithIndex
[A1 >: (QName, String), That]
(implicit bf: CanBuildFrom[Attributes, (A1, Int), That]): That
Deprecated Value Members
-
def
elements
: Iterator[(QName, String)]
-
def
first
: (QName, String)
-
def
firstOption
: Option[(QName, String)]
-
def
mapElements
[C]
(f: (String) ⇒ C): Map[QName, C]
-
def
projection
: IterableView[(QName, String), Attributes]
Inherited from Map[QName, String]
Inherited from Map[QName, String]
Inherited from PartialFunction[QName, String]
Inherited from (QName) ⇒ String
Inherited from GenMap[QName, String]
Inherited from Iterable[(QName, String)]
Inherited from Iterable[(QName, String)]
Inherited from Equals
Inherited from GenIterable[(QName, String)]
Inherited from Traversable[(QName, String)]
Inherited from Immutable
Inherited from Traversable[(QName, String)]
Inherited from GenTraversable[(QName, String)]
Inherited from GenericTraversableTemplate[(QName, String), Iterable]
Inherited from Parallelizable[(QName, String), ParMap[QName, String]]
Inherited from TraversableOnce[(QName, String)]
Inherited from GenTraversableOnce[(QName, String)]
Inherited from AnyRef
Inherited from Any
A special implementation of scala.collection.Map
[QName, String]with nice overloading and some implicit magic designed for use containing element attributes in Elem. The actual stored keys are of type QName. This is how (optional) namespace information for attributes is stored in Anti-XML trees. However, there are some syntactic tricks which allow you to ignore the QName boiler-plate when you don't actually need namespace support. For example:val attrs = Attributes("foo" -> "bar", "baz" -> "bin") attrs("foo") // => "bar" attrs(QName(None, "foo")) // => "bar" val attrs2 = attrs + ("even" -> "more") // => Attributes(...) val attrs3 = attrs + (QName(Some("pre"), "even" -> "less") // => Attributes(...)With very, very few exceptions,
Stringand QName are interchangable. Of course, this is being done with implicit conversions. However, you don't need to worry about the conversionString => QNamepoluting the implicit dispatch space! The conversion is defined on the companion object for QName, meaning that the compiler will only select it when the result of an expression is explicitly of typeQName. It will not automatically inject the conversion to satisfy method dispatch onString. For example:In this example, it is important to note that
nsis a method on QName. Thus, if the implicit conversion were pimp-enabling, the compiler would have accepted the last line of the example. However, as you can see, the implicit dispatch space has not been cluttered while the convenience ofStringrather than QName has been preserved.One implicit space-cluttering that couldn't be avoided is the conversion defined as
(String, String) => (QName, String). This is required to enable the niceStringsyntax on things like the+method and the companion objectapplyfactory. Unfortunately, this conversion had to be defined in the antixml companion object. Fortunately, it is a conversion within the same type (simply different parameters passed toTuple2). Thus, it shouldn't cause any scoping problems.QName