ВУЗ: Не указан

Категория: Не указан

Дисциплина: Не указана

Добавлен: 02.01.2026

Просмотров: 3456

Скачиваний: 0

ВНИМАНИЕ! Если данный файл нарушает Ваши авторские права, то обязательно сообщите нам.

Index

847

on Map traits, 386, 559 on Set traits, 384, 553

-- (remove elements)

on Map traits, 386, 559 on Set traits, 384, 553 --= (remove elements from)

on trait mutable.Map, 387, 560 on trait mutable.Set, 385, 554

-= (remove element from)

on trait mutable.Map, 387, 560 on trait mutable.Set, 384, 553 on trait Buffer, 551

-> (map to), 95

in implicit conversion, 488 / (divided by)

on numeric types, 128 /: (fold left)

on class List, 365

on trait Iterator, 598

on Traversable traits, 541 : (colon)

in type annotations, 70 :+ (append)

on Seq traits, 548 :: (cons) class

as pattern constructor, 348 subclass of List, 503506

:: (cons) method

on class List, 86, 345

right associativity of, 87, 346

::: (concatenation)

on class List, 86, 349, 505 :\ (fold right)

on class List, 366

on trait Iterator, 598

on Traversable traits, 541 ; (semicolon)

inference, 108 < (less than)

on numeric types, 129 <- (in)

in for expressions, 79

<: (upper bound), 445 << (shift left)

on integral types, 132 <= (less than or equal to)

on numeric types, 129 <% (view bound), 497

= (variable assignment), 70 == (equals)

in set membership, 383 == (equals)

in Scala versus Java, 134 in-depth treatment, 684709 method on Any, 132, 250, 684 quick introduction, 132134

=== (triple equals)

in ScalaTest suites, 298 => (right arrow, or “rocket”)

in function literals, 78

in import statements, 284285 in self types, 679

in match alternatives, 174 in this aliasing, 776

> (greater than)

on numeric types, 129 >: (lower bound), 437

>= (greater than or equal to) on numeric types, 129

>> (shift right)

on integral types, 132

>>> (unsigned shift right) on integral types, 132

@ (at sign)

in annotations, 648 in patterns, 323

to extract XML attributes, 662

# (pound sign)

in inner class type names, 463 % (remainder)

on numeric types, 128 & (bitwise-and)

on integral types, 131 & (intersect)

Cover · Overview · Contents · Discuss · Suggest · Glossary · Index


on Set traits, 384, 553 && (logical-and)

on class Boolean, 130 &~ (diff)

on Set traits, 553 _ (underscore)

in curried functions, 215 in existential types, 702

in function literals, 191, 210 in identifiers, 152

in import statements, 285 in match expressions, 173 used to initialize a field to its default value, 404

_* (underscore asterisk)

in XML pattern matching, 666 repeated parameter, 200 sequence wildcard pattern, 638

_1, _2, etc.(tuple accessors), 90 _= (underscore equals)

in setter method names, 402 ^ (exclusive-or)

on integral types, 131 ^^ (result conversion, or

“eyebrows”) parser combinator, 768

~(bitwise complement) on integral types, 131

~(sequential composition, or “squiggle”)

parser combinator, 768, 777 ~! (committed sequential

composition) parser combinator, 785

~> (sequential composition right) parser combinator, 769, 778

<~ (sequential composition left) parser combinator, 769, 778

\ (extract)

on class Elem, 662 \\ (deep extract)

on class Elem, 662

Index

848

{} (curly braces)

and variable scope, 178 in class definitions, 140 in imports, 284

in XML literals, 658659 in XML patterns, 665 instead of parentheses in

method invocations, 216 instead of parentheses in for

expressions, 167 (back tick)

in constants, 317 in identifiers, 153

| (alternative composition) parser combinator, 778 | (alternative composition) parser combinator, 769

| (bitwise-or)

on integral types, 131 || (logical-or)

on class Boolean, 130 | (union)

on Set traits, 553

A

Abelson, Harold, 405, 522 abs method

on class Double (via

RichDouble), 138

on class Int (via RichInt), 149, 253

abstract members, 447 abstract modifier

not needed on abstract methods, fields, or types, 224, 447

on classes, 223

with override modifier on members of traits, 269

abstract types, 459

access modifiers, 287291 accessor methods, 402 Actor trait, 725

methods

Cover · Overview · Contents · Discuss · Suggest · Glossary · Index


Index

849

! (message send), 53, 727 actor, 727

act, 725 loop, 732 react, 731

receiveWithin, 730 receive, 728 start, 726

actors, 53, 564, 724758, 794 add method

on trait mutable.Set, 553 addString method

on class List, 357

on trait Iterator, 599

on Traversable traits, 542 Aho, Alfred, 522, 785n

aliases

AnyRef for Object, 254 type, 448

aliasing

this, 776

object, see defensive copies alphabetic versus symbolic names,

773 alternatives

catch-all, 314 definition of, 826

in match expressions, 173, 312 in catch clauses, 171

in partial function literals, 331 annotations

and reflection, 716 applied to expressions, 649 arguments to, 649

@BeanProperty, 653 @deprecated, 648, 651 in meta-programming, 648 in testing, 301 Java-specific, 713

@native, 654 nested, 650

@serializable, 652, 714

@SerialVersionUID, 652 standard, 650

syntax of, 649

@tailrec, 653 @Test

in JUnit 4, 716

in TestNG, 302

@throws, 714 @transient, 653 type, 50, 64, 70

for debugging, 375 @unchecked, 328, 413, 649,

654

used with named arguments, 650

variance, 430

@volatile, 652 anonymous classes, 451

anonymous functions, see function literals

ANTLR, 759 Any class, 251

in Scala class hierarchy diagram, 252

AnyRef class, 251

as alias of Object, 254 in Scala class hierarchy diagram, 252

AnyVal class, 251

in Scala class hierarchy diagram, 252

application

function to arguments, 192 partial function, 192, 360

Application trait, 115, 789 applications, Scala, 112115 apply method

called with parentheses, 83 in extractors, 633

on Array class, 83 object, 85

Cover · Overview · Contents · Discuss · Suggest · Glossary · Index


Index

850

on List class, 355

object, 86, 369, 640 on Map

objects, 95

traits, 385, 386, 558 on Seq objects, 602 on Seq traits, 548

on Set objects, 91

on trait PartialFunction, 333 on FunctionN traits, 188

args variable

in scripts, 75 arguments

command line, in scripts, 75 named, 200

variable length, 199 versus parameters, 834

arithmetic operations (+, -, *, /, %) on numeric types, 128129

Array class, 378

ArrayBuffer class, 380 arrays, 240, 378

accessed with () not [], 83 cloning, 738

converting to lists, 394 creating and initializing, 85 generic, 580

passing elements as arguments with _*, 200

quick introduction, 8285 asInstanceOf method

on class Any, 320 assert method

on object Predef, 98, 295

AssertionError class, 295 assertions, 295297 assignment

result is unit value, 163 associativity, 136137

right versus left, 87, 136 asynchronous messages, 736

attributes

XML, 657, 662 automatic

boxing, 254 conversion, see implicit

conversion imports, 286287

auxiliary constructors, 146147

B backtracking, 784

base classes, see superclasses BDD, see behavior-driven

development BeanProperty annotation, 653,

672n Beck, Kent, 300

behavior-driven development, 302 Beust, Cédric, 301

BigInt class, 51

BigInteger class, 52 Bison, 759

bitwise operations, on integral types logical (&, |, ^, ~), 131

shift (<<, >>, >>>), 132 blank finals (Java)

not in Scala, 404

Bloch, Joshua, 685n, 698n, 706n blocks, definition of, 827 Boolean class, 118, 129 boolean literals, 124

bottom types, 256

bound variables, 167, 195 boxing, of value types, 254 Bracha, Gilad, 522

break keyword (Java) living without, 175

not in match expressions, 174 break method

on class Breaks, 177 breakable method

on class Breaks, 177 Breaks class, 177

Cover · Overview · Contents · Discuss · Suggest · Glossary · Index


Index

851

buffer

members, 551

Buffer trait methods

++=: (prepend), 551 ++= (append), 551 +=: (prepend), 551 += (append), 551

-= (remove element from), 551

clear, 551 clone, 551 insert, 551 insertAll, 551 remove, 551 trimEnd, 551 trimStart, 551

buffered method

on trait Iterator, 595

ButtonClicked class, 793 by-name parameters, 219, 411 by-value parameters, 779 Byte class, 117, 707

C

C language, 57

parser generators, 759 C++ language, 57, 96

C# language, 96 enumerations, 466 properties, 404

static extension methods, 479 Callahan, Harry, 737

camel casing, 151

CanBuildFrom trait, 613 capitalization, of identifiers, 151 capitalize method

on class Int (via RichInt), 138 case classes, 310311

and actors, 738

versus extractors, 641642 cases, see alternatives

casting, see also toInt, toChar, etc.

with asInstanceOf, 320 with typed patterns (the

preferred style), 319 catch clauses, 170

Cathedral and the Bazaar, The

(Raymond), 51 chained package clauses, 281 Char class, 117, 707 character encoding

in XML, 664 character literals, 121

escape sequences, 122 checked exceptions, 171, 714 Church, Alonzo, 56

Class class, see classOf method class hierarchy diagram

for lists, 504 for maps, 94 for Scala, 252 for sets, 92

class manifest, 581 class parameters, 140

initialization order compared to abstract fields, 453

not legal on singleton objects, 112

used to implement abstract fields, 506

classes, 103105 abstract, 223 annotating, 649 anonymous, 451 case, 310311 companion, 110 generic, 422

inner, see inner classes nesting of, 244 private, 427

sealed, 326328 classOf method

on object Predef, 299, 715 clear method

Cover · Overview · Contents · Discuss · Suggest · Glossary · Index