sealed
trait
Dictionary[A] extends Any
Value Members
-
-
final
def
##(): Int
-
def
+[B1 >: B](elem1: (String, B1), elem2: (String, B1), elems: (String, B1)*): Map[String, B1]
-
def
+[B1 >: B](kv: (String, B1)): Map[String, B1]
-
def
+(other: String): String
-
def
++[B1 >: B](xs: GenTraversableOnce[(String, B1)]): Map[String, B1]
-
-
-
-
-
-
-
def
-(elem1: String, elem2: String, elems: String*): WrappedDictionary[A]
-
-
-
-
-
-
def
->[B](y: B): (Dictionary[A], B)
-
def
/:[B](z: B)(op: (B, (String, A)) ⇒ B): B
-
def
:\[B](z: B)(op: ((String, A), B) ⇒ B): B
-
-
def
addString(b: StringBuilder, start: String, sep: String, end: String): StringBuilder
-
-
-
def
aggregate[B](z: ⇒ B)(seqop: (B, (String, A)) ⇒ B, combop: (B, B) ⇒ B): B
-
def
andThen[C](k: (A) ⇒ C): PartialFunction[String, C]
-
def
apply(key: String): A
-
def
applyOrElse[A1 <: A, B1 >: B](x: A1, default: (A1) ⇒ B1): B1
-
final
def
asInstanceOf[T0]: T0
-
-
def
clear(): Unit
-
def
clone(): AnyRef
-
-
def
collectFirst[B](pf: PartialFunction[(String, A), B]): Option[B]
-
-
def
compose[A](g: (A) ⇒ String): (A) ⇒ A
-
def
contains(key: String): Boolean
-
def
copyToArray[B >: A](xs: scala.Array[B], start: Int, len: Int): Unit
-
def
copyToArray[B >: A](xs: scala.Array[B]): Unit
-
def
copyToArray[B >: A](xs: scala.Array[B], start: Int): Unit
-
def
copyToBuffer[B >: A](dest: Buffer[B]): Unit
-
def
count(p: ((String, A)) ⇒ Boolean): Int
-
def
default(key: String): A
-
def
delete(key: String): Unit
-
-
-
-
-
-
-
-
-
-
-
-
def
exists(p: ((String, A)) ⇒ Boolean): Boolean
-
-
def
filterKeys(p: (String) ⇒ Boolean): Map[String, A]
-
-
def
finalize(): Unit
-
def
find(p: ((String, A)) ⇒ Boolean): Option[(String, A)]
-
-
-
def
fold[A1 >: A](z: A1)(op: (A1, A1) ⇒ A1): A1
-
def
foldLeft[B](z: B)(op: (B, (String, A)) ⇒ B): B
-
def
foldRight[B](z: B)(op: ((String, A), B) ⇒ B): B
-
def
forall(p: ((String, A)) ⇒ Boolean): Boolean
-
def
foreach[U](f: ((String, A)) ⇒ U): Unit
-
def
formatted(fmtstr: String): String
-
-
def
get(key: String): Option[A]
-
final
def
getClass(): Class[_]
-
def
getOrElse[B1 >: B](key: String, default: ⇒ B1): B1
-
def
getOrElseUpdate(key: String, op: ⇒ A): A
-
def
groupBy[K](f: ((String, A)) ⇒ K): Map[K, WrappedDictionary[A]]
-
-
def
hasDefiniteSize: Boolean
-
def
hashCode(): Int
-
def
head: (String, A)
-
def
headOption: Option[(String, A)]
-
-
-
def
isDefinedAt(key: String): Boolean
-
-
final
def
isInstanceOf[T0]: Boolean
-
final
def
isTraversableAgain: Boolean
-
def
iterator: Iterator[(String, A)]
-
def
keySet: Set[String]
-
def
keys: Iterable[String]
-
-
def
last: (String, A)
-
def
lastOption: Option[(String, A)]
-
def
lift: (String) ⇒ Option[A]
-
def
map[B, That](f: ((String, A)) ⇒ B)(implicit bf: CanBuildFrom[WrappedDictionary[A], B, That]): That
-
def
mapResult[NewTo](f: (WrappedDictionary[A]) ⇒ NewTo): Builder[(String, A), NewTo]
-
def
mapValues[C](f: (A) ⇒ C): Map[String, C]
-
def
max[B >: A](implicit cmp: Ordering[B]): (String, A)
-
def
maxBy[B](f: ((String, A)) ⇒ B)(implicit cmp: Ordering[B]): (String, A)
-
def
min[B >: A](implicit cmp: Ordering[B]): (String, A)
-
def
minBy[B](f: ((String, A)) ⇒ B)(implicit cmp: Ordering[B]): (String, A)
-
def
mkString: String
-
def
mkString(sep: String): String
-
def
mkString(start: String, sep: String, end: String): String
-
-
-
final
def
notify(): Unit
-
final
def
notifyAll(): Unit
-
-
def
par: ParMap[String, A]
-
-
def
product[B >: A](implicit num: Numeric[B]): B
-
def
put(key: String, value: A): Option[A]
-
def
reduce[A1 >: A](op: (A1, A1) ⇒ A1): A1
-
def
reduceLeft[B >: A](op: (B, (String, A)) ⇒ B): B
-
def
reduceLeftOption[B >: A](op: (B, (String, A)) ⇒ B): Option[B]
-
def
reduceOption[A1 >: A](op: (A1, A1) ⇒ A1): Option[A1]
-
def
reduceRight[B >: A](op: ((String, A), B) ⇒ B): B
-
def
reduceRightOption[B >: A](op: ((String, A), B) ⇒ B): Option[B]
-
def
remove(key: String): Option[A]
-
-
-
-
def
runWith[U](action: (A) ⇒ U): (String) ⇒ Boolean
-
def
sameElements[B >: A](that: GenIterable[B]): Boolean
-
def
scan[B >: A, That](z: B)(op: (B, B) ⇒ B)(implicit cbf: CanBuildFrom[WrappedDictionary[A], B, That]): That
-
def
scanLeft[B, That](z: B)(op: (B, (String, A)) ⇒ B)(implicit bf: CanBuildFrom[WrappedDictionary[A], B, That]): That
-
def
scanRight[B, That](z: B)(op: ((String, A), B) ⇒ B)(implicit bf: CanBuildFrom[WrappedDictionary[A], B, That]): That
-
def
seq: Map[String, A]
-
def
size: Int
-
-
-
def
sizeHint(size: Int): Unit
-
def
sizeHintBounded(size: Int, boundingColl: TraversableLike[_, _]): Unit
-
-
-
-
-
-
def
stringPrefix: String
-
def
sum[B >: A](implicit num: Numeric[B]): B
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
-
-
-
-
-
-
def
to[Col[_]](implicit cbf: CanBuildFrom[Nothing, (String, A), Col[(String, A)]]): Col[(String, A)]
-
def
toArray[B >: A](implicit arg0: ClassTag[B]): scala.Array[B]
-
def
toBuffer[C >: (A, B)]: Buffer[C]
-
-
-
-
def
toList: List[(String, A)]
-
def
toMap[T, U](implicit ev: <:<[(String, A), (T, U)]): Map[T, U]
-
-
def
toSet[B >: A]: Set[B]
-
def
toStream: collection.immutable.Stream[(String, A)]
-
def
toString(): String
-
-
def
toVector: Vector[(String, A)]
-
-
-
-
-
def
update(key: String, value: A): Unit
-
def
updated[B1 >: B](key: String, value: B1): Map[String, B1]
-
-
-
def
view(from: Int, until: Int): IterableView[(String, A), WrappedDictionary[A]]
-
def
view: IterableView[(String, A), WrappedDictionary[A]]
-
final
def
wait(): Unit
-
final
def
wait(arg0: Long, arg1: Int): Unit
-
final
def
wait(arg0: Long): Unit
-
def
withDefault(d: (String) ⇒ A): Map[String, A]
-
def
withDefaultValue(d: A): Map[String, A]
-
-
-
def
zipAll[B, A1 >: A, That](that: GenIterable[B], thisElem: A1, thatElem: B)(implicit bf: CanBuildFrom[WrappedDictionary[A], (A1, B), That]): That
-
def
zipWithIndex[A1 >: A, That](implicit bf: CanBuildFrom[WrappedDictionary[A], (A1, Int), That]): That
-
def
→[B](y: B): (Dictionary[A], B)
Shadowed Implicit Value Members
-
-
-
def
hashCode(): Int
-
def
toString(): String
-
def
update(key: String, value: A): Unit
Dictionary "view" of a JavaScript value.
Using objects as dictionaries (maps from strings to values) through their properties is a common idiom in JavaScript. This trait lets you treat an object as such a dictionary, with the familiar API of a Map.
To use it, cast your object, say
x
, into a Dictionary usingthen use it as
To enumerate all the keys of a dictionary, use collection methods or for comprehensions. For example:
Note that this does not enumerate properties in the prototype chain of
xDict
.This trait extends js.Any directly, because it is not safe to call methods of js.Object on it, given that the name of these methods could be used as keys in the dictionary.