sealed
trait
Dictionary[A] extends Object
Abstract Value Members
-
abstract
def
apply(key: String): A
-
abstract
def
get(key: String): UndefOr[A]
-
abstract
def
update(key: String, value: A): Unit
Concrete Value Members
-
final
def
!=(arg0: scala.Any): scala.Boolean
-
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: Predef.String): Predef.String
-
def
++[B1 >: B](xs: GenTraversableOnce[(String, B1)]): Map[String, B1]
-
def
++[B >: A, That](that: GenTraversableOnce[B])(implicit bf: CanBuildFrom[WrappedDictionary[A], B, That]): That
-
def
++:[B >: A, That](that: collection.Traversable[B])(implicit bf: CanBuildFrom[WrappedDictionary[A], B, That]): That
-
def
++:[B >: A, That](that: collection.TraversableOnce[B])(implicit bf: CanBuildFrom[WrappedDictionary[A], B, That]): That
-
def
++=(xs: collection.TraversableOnce[(java.lang.String, A)]): WrappedDictionary[A]
-
def
+=(kv: (java.lang.String, A)): WrappedDictionary[A]
-
def
+=(elem1: (java.lang.String, A), elem2: (java.lang.String, A), elems: (java.lang.String, A)*): WrappedDictionary[A]
-
-
-
-
def
--=(xs: collection.TraversableOnce[java.lang.String]): WrappedDictionary[A]
-
-
def
-=(elem1: java.lang.String, elem2: java.lang.String, elems: java.lang.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
-
final
def
==(arg0: scala.Any): scala.Boolean
-
def
addString(b: StringBuilder, start: Predef.String, sep: Predef.String, end: Predef.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
applyOrElse[A1 <: A, B1 >: B](x: A1, default: (A1) ⇒ B1): B1
-
final
def
asInstanceOf[T0]: T0
-
def
canEqual(that: scala.Any): scala.Boolean
-
def
clear(): Unit
-
def
clone(): AnyRef
-
def
collect[B, That](pf: PartialFunction[(String, A), B])(implicit bf: CanBuildFrom[WrappedDictionary[A], B, That]): That
-
def
collectFirst[B](pf: PartialFunction[(String, A), B]): Option[B]
-
def
companion: GenericCompanion[collection.mutable.Iterable]
-
def
compose[A](g: (A) ⇒ String): (A) ⇒ A
-
def
contains(key: String): scala.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)) ⇒ scala.Boolean): Int
-
def
default(key: String): A
-
def
delete(key: String): Unit
-
-
-
-
-
-
def
ensuring(cond: (Dictionary[A]) ⇒ scala.Boolean, msg: ⇒ scala.Any): Dictionary[A]
-
def
ensuring(cond: (Dictionary[A]) ⇒ scala.Boolean): Dictionary[A]
-
def
ensuring(cond: scala.Boolean, msg: ⇒ scala.Any): Dictionary[A]
-
def
ensuring(cond: scala.Boolean): Dictionary[A]
-
final
def
eq(arg0: AnyRef): scala.Boolean
-
def
equals(arg0: scala.Any): scala.Boolean
-
def
exists(p: ((String, A)) ⇒ scala.Boolean): scala.Boolean
-
-
def
filterKeys(p: (String) ⇒ scala.Boolean): Map[String, A]
-
-
def
finalize(): Unit
-
def
find(p: ((String, A)) ⇒ scala.Boolean): Option[(String, A)]
-
def
flatMap[B, That](f: ((String, A)) ⇒ GenTraversableOnce[B])(implicit bf: CanBuildFrom[WrappedDictionary[A], B, That]): That
-
def
flatten[B](implicit asTraversable: ((String, A)) ⇒ GenTraversableOnce[B]): collection.mutable.Iterable[B]
-
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)) ⇒ scala.Boolean): scala.Boolean
-
def
foreach[U](f: ((String, A)) ⇒ U): Unit
-
def
formatted(fmtstr: Predef.String): Predef.String
-
def
genericBuilder[B]: Builder[B, collection.mutable.Iterable[B]]
-
final
def
getClass(): Class[_]
-
def
getOrElse[B1 >: B](key: String, default: ⇒ B1): B1
-
def
getOrElseUpdate(key: String, op: ⇒ A): A
-
-
def
grouped(size: Int): collection.Iterator[WrappedDictionary[A]]
-
def
hasDefiniteSize: scala.Boolean
-
-
def
hashCode(): Int
-
def
head: (String, A)
-
def
headOption: Option[(String, A)]
-
-
def
inits: collection.Iterator[WrappedDictionary[A]]
-
def
isDefinedAt(key: String): scala.Boolean
-
def
isEmpty: scala.Boolean
-
final
def
isInstanceOf[T0]: scala.Boolean
-
-
final
def
isTraversableAgain: scala.Boolean
-
-
def
keySet: Set[String]
-
def
keys: collection.Iterable[String]
-
def
keysIterator: collection.Iterator[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: Predef.String
-
def
mkString(sep: Predef.String): Predef.String
-
def
mkString(start: Predef.String, sep: Predef.String, end: Predef.String): Predef.String
-
final
def
ne(arg0: AnyRef): scala.Boolean
-
def
nonEmpty: scala.Boolean
-
final
def
notify(): Unit
-
final
def
notifyAll(): Unit
-
def
orElse[A1 <: A, B1 >: B](that: PartialFunction[A1, B1]): PartialFunction[A1, B1]
-
def
par: ParMap[String, A]
-
-
def
product[B >: A](implicit num: Numeric[B]): B
-
def
propertyIsEnumerable(v: String): Boolean
-
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
retain(p: (java.lang.String, A) ⇒ scala.Boolean): WrappedDictionary[A]
-
def
runWith[U](action: (A) ⇒ U): (String) ⇒ scala.Boolean
-
def
sameElements[B >: A](that: GenIterable[B]): scala.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(coll: TraversableLike[_, _], delta: Int): Unit
-
def
sizeHint(coll: TraversableLike[_, _]): Unit
-
def
sizeHint(size: Int): Unit
-
def
sizeHintBounded(size: Int, boundingColl: TraversableLike[_, _]): Unit
-
def
slice(from: Int, until: Int): WrappedDictionary[A]
-
def
sliding(size: Int, step: Int): collection.Iterator[WrappedDictionary[A]]
-
def
sliding(size: Int): collection.Iterator[WrappedDictionary[A]]
-
-
-
def
stringPrefix: Predef.String
-
def
sum[B >: A](implicit num: Numeric[B]): B
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
-
-
def
tails: collection.Iterator[WrappedDictionary[A]]
-
-
-
-
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
toIndexedSeq: collection.immutable.IndexedSeq[(String, A)]
-
def
toIterable: collection.Iterable[(String, A)]
-
def
toIterator: collection.Iterator[(String, A)]
-
-
def
toLocaleString(): String
-
def
toMap[T, U](implicit ev: <:<[(String, A), (T, U)]): Map[T, U]
-
def
toSeq: collection.Seq[(String, A)]
-
def
toSet[B >: A]: Set[B]
-
def
toStream: collection.immutable.Stream[(String, A)]
-
def
toString(): java.lang.String
-
def
toTraversable: collection.Traversable[(String, A)]
-
-
def
transform(f: (java.lang.String, A) ⇒ A): WrappedDictionary[A]
-
def
transpose[B](implicit asTraversable: ((String, A)) ⇒ GenTraversableOnce[B]): collection.mutable.Iterable[collection.mutable.Iterable[B]]
-
def
unzip[A1, A2](implicit asPair: ((String, A)) ⇒ (A1, A2)): (collection.mutable.Iterable[A1], collection.mutable.Iterable[A2])
-
def
unzip3[A1, A2, A3](implicit asTriple: ((String, A)) ⇒ (A1, A2, A3)): (collection.mutable.Iterable[A1], collection.mutable.Iterable[A2], collection.mutable.Iterable[A3])
-
def
updated[B1 >: B](key: String, value: B1): Map[String, B1]
-
def
valueOf(): scala.Any
-
def
values: collection.Iterable[A]
-
def
valuesIterator: collection.Iterator[A]
-
def
view(from: Int, until: Int): 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
withFilter(p: ((String, A)) ⇒ scala.Boolean): FilterMonadic[(String, A), WrappedDictionary[A]]
-
def
zip[A1 >: A, B, That](that: GenIterable[B])(implicit bf: CanBuildFrom[WrappedDictionary[A], (A1, B), That]): That
-
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
apply(key: String): A
-
-
def
equals(that: scala.Any): scala.Boolean
-
def
get(key: String): Option[A]
-
def
hashCode(): Int
-
def
toString(): Predef.String
-
def
update(key: String, value: A): Unit
Deprecated Value Members
-
def
unary_!(): Boolean
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.
To use it, cast your object, say
x
, into a Dictionary usingthen use it as
To enumerate all the keys of a dictionary, use js.Object.keys, which returns a js.Array of the properties. It can be used in a for comprehension like this: