Kotlin in action:
Gespeichert in:
Hauptverfasser: | , |
---|---|
Weitere Verfasser: | |
Format: | Buch |
Sprache: | English |
Veröffentlicht: |
Shelter Island, NY
Manning
[2017]
|
Schlagworte: | |
Online-Zugang: | Inhaltsverzeichnis |
Beschreibung: | xxv, 334 Seiten Diagramme |
ISBN: | 1617293296 9781617293290 |
Internformat
MARC
LEADER | 00000nam a2200000 c 4500 | ||
---|---|---|---|
001 | BV044320300 | ||
003 | DE-604 | ||
005 | 20191217 | ||
007 | t | ||
008 | 170520s2017 |||| |||| 00||| eng d | ||
010 | |a 2017286272 | ||
020 | |a 1617293296 |c pbk. : ca. EUR 29.95, US $ 44.99, CAN $ 51.99 |9 1-61729-329-6 | ||
020 | |a 9781617293290 |c pbk. |9 978-1-61729-329-0 | ||
035 | |a (OCoLC)982134572 | ||
035 | |a (DE-599)BVBBV044320300 | ||
040 | |a DE-604 |b ger |e rda | ||
041 | 0 | |a eng | |
049 | |a DE-11 |a DE-863 |a DE-473 |a DE-91G |a DE-83 |a DE-573 |a DE-92 |a DE-703 |a DE-860 |a DE-898 | ||
050 | 0 | |a QA76.62 .J46 2017 | |
082 | 0 | |a 005.133 |2 23 | |
084 | |a ST 250 |0 (DE-625)143626: |2 rvk | ||
084 | |a DAT 362f |2 stub | ||
100 | 1 | |a Jemerov, Dmitry |0 (DE-588)1130898210 |4 aut | |
245 | 1 | 0 | |a Kotlin in action |c Dmitry Jemerov and Svetlana Isakova ; foreword by Andrey Breslav |
264 | 1 | |a Shelter Island, NY |b Manning |c [2017] | |
264 | 4 | |c © 2017 | |
300 | |a xxv, 334 Seiten |b Diagramme | ||
336 | |b txt |2 rdacontent | ||
337 | |b n |2 rdamedia | ||
338 | |b nc |2 rdacarrier | ||
650 | 4 | |a Kotlin (Computer program language) | |
650 | 4 | |a Java (Computer program language) | |
650 | 4 | |a Programming language | |
650 | 4 | |a Functional programming (Computer science) | |
650 | 0 | 7 | |a Kotlin |g Programmiersprache |0 (DE-588)1136341129 |2 gnd |9 rswk-swf |
689 | 0 | 0 | |a Kotlin |g Programmiersprache |0 (DE-588)1136341129 |D s |
689 | 0 | |5 DE-604 | |
700 | 1 | |a Isakova, Svetlana |0 (DE-588)1130898547 |4 aut | |
700 | 1 | |a Breslav, Andrey |4 aui | |
856 | 4 | 2 | |m HBZ Datenaustausch |q application/pdf |u http://bvbr.bib-bvb.de:8991/F?func=service&doc_library=BVB01&local_base=BVB01&doc_number=029723784&sequence=000001&line_number=0001&func_code=DB_RECORDS&service_type=MEDIA |3 Inhaltsverzeichnis |
999 | |a oai:aleph.bib-bvb.de:BVB01-029723784 |
Datensatz im Suchindex
DE-BY-863_location | 1340 |
---|---|
DE-BY-FWS_call_number | 1340/ST 250 K76 J49 |
DE-BY-FWS_katkey | 648379 |
DE-BY-FWS_media_number | 083101354497 |
_version_ | 1806176783973744640 |
adam_text | Titel: Kotlin in action
Autor: Jemerov, Dmitry
Jahr: 2017
contents
foreword xv
preface xvii
acknowledgments xix
about this book xxi
about the authors xxiv
about the cover illustration xxv
Part 1 Introducing Kotlin .................................... I
j Kotlin: what and why 3
1.1 A taste of Kotlin 3
1.2 Kotlin s primary traits 4
Target platforms: server-side, Android, anywhere Java runs 4
Statically typed 5 • Functional and object-oriented 6
Free and open source 7
1.3 Kotlin applications 7
Kotlin on the server side 8 • Kotlin on Android 9
1.4 The philosophy of Kotlin 10
Pragmatic 10 ¦ Concise 11 • Safe 12 • Interoperable 12
1.5 Using the Kotlin tools 13
Compiling Kotlin code 13 ¦ Plug-in for IntelliJ IDEA and Android
Studio 14 • Interactive shell 15 • Eclipse plug-in 15
Online playground 15 ¦ Java-to-Kotlin converter 15
1.6 Summary 15
vii
viii
CONTENTS
0 Kotlin basics 17
2.1 Basic elements: functions and variables 18
Hello, world! 18 • Functions 18 • Variables 20
Easier string formatting: string templates 22
2.2 Classes and properties 23
Properties 23 • Custom accessors 25 • Kotlin source code
layout: directories and packages 26
2.3 Representing and handling choices: enums and when 28
Declaring enum classes 28 • Using when to deal with enum
classes 29 • Using when with arbitrary objects 30
Using when without an argument 31 • Smart casts: combining
type checks and casts 31 • Refadoring: replacing if with
when 33 • Blocks as branches of f and when 34
2.4 Iterating over things: while and for loops 35
The while loop 35 • Iterating aver numbers: ranges and
progressions 36 • Iterating over maps 37 Using in to check
collection and range membership 38
2.5 Exceptions in Kodin 39
try , catch , and finally 40 • try as an expression 41
2.6 Summary 42
Defining and calling functions 44
3.1 Creating collections in Kodin 45
3.2 Making functions easier to call 46
Named arguments 47 ¦ Default parameter values 48
Getting rid of static utility classes: top-level functions and
properties 49
3.3 Adding methods to other people s classes: extension
functions and properties 51
Imports and extension functions 53 • Calling extension
functions from Java 53 ¦ Utility functions as extensions 54
No overriding for extension functions 55 • Extension
properties 56
3.4 Working with collections: varargs, infix calls,
and library support 57
Extending the Java Collections API 57 Varargs: functions that
accept an arbitrary number of arguments 58 ¦ Working with pairs:
infix calls and destructuring declarations 59
CONTENTS
ix
3.5 Working with strings and regular expressions 60
Splitting strings 60 • Regular expressions and triple-quoted
strings 61 • Multiline triple-quoted strings 62
3.6 Making your code tidy: local functions and
extensions 64
3.7 Summary 66
Classes, objects, and interfaces 67
4.1 Defining class hierarchies 68
Interfaces in Kotlin 68 • Open, final, and abstract modifiers:
final by default 70 ¦ Visibility modifiers: public by default 73
Inner and nested classes: nested by default 75 ¦ Sealed classes:
defining restricted class hierarchies 77
4.2 Declaring a class with nontrivial constructors
or properties 78
Initializing classes: primary constructor and initializer blocks 79
Secondary constructors: initializing the superclass in different
ways 81 • Implementing properties declared in interfaces 83
Accessing a backing field from a getter or setter 85
Changing accessor visibility 86
4.3 Compiler-generated methods: data classes and class
delegation 87
Universal object methods 87 • Data classes: autogenerated
implementations of universal methods 89 • Class delegation:
using the by keyword 91
4.4 The object keyword: declaring a class and creating an
instance, combined 93
Object declarations: singletons made easy 93 ¦ Companion
objects: a place for factory methods and static members 96
Companion objects as regular objects 98 • Object expressions:
anonymous inner classes rephrased 100
4.5 Summary 101
Programming with lambdas 103
5.1 Lambda expressions and member references 104
Introduction to lambdas: blocks of code as function parameters 104
Lambdas and collections 105 • Syntax for lambda
expressions 106 • Accessing variables in scope 109
Member references 111
CONTENTS
5.2 Functional APIs for collections 113
Essentials: filter and map 113 ¦ all , any , count ,
and find : applying a predicate to a collection 115
groupBy: converting a list to a map of groups 117
flatMap and flatten: processing elements in nested
collections 117
5.3 Lazy collection operations: sequences 118
Executing sequence operations: intermediate and terminal
operations 120 • Creating sequences 122
5.4 Using Java functional interfaces 123
Passing a lambda as a parameter to a Java method 124
SAM constructors: explicit conversion of lambdas to
functional interfaces 126
5.5 Lambdas with receivers: with and apply 128
The with function 128 • The apply
function 130
5.6 Summary 131
The Kotlin type system 133
6.1 Nullability 133
Nullable types 134 • The meaning of types 136 • Safe call
operator: ?. 137 • Elvis operator: ?: 139 • Safe casts:
as? 140 • Not-null assertions: 141 ¦ The let
function 143 • Late-initialized properties 145 • Extensions
for nullable types 146 • Nullability of type parameters 148
Nullability and Java 149
6.2 Primitive and other basic types 153
Primitive types: Int, Boolean, and more 153 • Nullable primitive
types: Int?, Boolean?, and more 154 • Number conversions 155
Any and Any? : the root types 157 • The Unit type:
Kotlin s void 157 • The Nothing type: This function
never returns 158
6.3 Collections and arrays 159
Nullability and collections 159 ¦ Read-only and mutable
collections 161 ¦ Kotlin collections and Java 163
Collections as platform types 165 • Arrays of objects
and primitive types 167
6.4 Summary 170
CONTENTS
xi
Part 2 Embracing Kotlin..................................... 171
7 Operator overloading and other conventions 173
7.1 Overloading arithmetic operators 174
Overloading binary arithmetic operations 174 • Overloading
compound assignment operators 177 ¦ Overloading unary
operators 178
7.2 Overloading comparison operators 180
Equality operators: equals 180 • Ordering operators:
compareTo 181
7.3 Conventions used for collections and ranges 182
Accessing elements by index: get and set 182 • The in
convention 184 • The rangeTo convention 185 ¦ The
iterator convention for the for loop 186
7.4 Destructuring declarations and component
functions 187
Destructuring declarations and loops 188
7.5 Reusing property accessor logic: delegated properties 189
Delegated properties: the basics 189 ¦ Using delegated properties:
lazy initialization and by lazy() 190 • Implementing delegated
properties 192 • Delegated-property translation rules 195
Storing property values in a map 196 • Delegated properties
in frameworks 197
7.6 Summary 199
^ Higher-order functions: lambdas as parameters
and return values 200
8.1 Declaring higher-order functions 201
Function types 201 • Calling functions passed as
arguments 202 • Using function types from Java 204
Default and null values for parameters with function types 205
Returning functions from functions 207 • Removing
duplication through lambdas 209
8.2 Inline functions: removing the overhead of lambdas 211
How inlining works 211 • Restrictions on inline functions 213
Inlining collection operations 214 • Deciding when to declare
functions as inline 215 • Using inlined lambdas for resource
management 216
xii
CONTENTS
8.3 Control flow in higher-order functions 217
Return statements in lambdas: return from an enclosing
function 217 • Returning from lambdas: return with a
label 218 ¦ Anonymous functions: local returns by default 220
8.4 Summary 221
C) Generics 223
9.1 Generic type parameters 224
Generic functions and properties 224 ¦ Declaring generic
classes 226 • Type parameter constraints 227
Making type parameters non-null 229
9.2 Generics at runtime: erased and reified type parameters 230
Generics at runtime: type checks and casts 230 • Declaring
functions with reified type parameters 233 • Replacing class
references with reified type parameters 235 • Restrictions on reified
type parameters 236
9.3 Variance: generics and subtyping 237
Why variance exists: passing an argument to a function 237
Classes, types, and subtypes 238 • Covariance: preserved
subtyping relation 240 • Contravariance: reversed subtyping
relation 244 ¦ Use-site variance: specifying variance for type
occurrences 246 • Star projection: using * instead of a type
argument 248
9.4 Summary 252
Annotations and reflection 254
10.1 Declaring and applying annotations 255
Applying annotations 255 • Annotation targets 256
Using annotations to customize fSON serialization 258
Declaring annotations 260 • Meta-annotations: controlling how
an annotation is processed 261 ¦ Classes as annotation
parameters 262 ¦ Generic classes as annotation parameters 263
10.2 Reflection: introspecting Kotlin objects at runtime 264
The Kotlin reflection API: KClass, KCallable, KFunction, and
KProperty 265 ¦ Implementing object serialization using
reflection 268 ¦ Customizing serialization with annotations 270
JSONparsing and object deserialization 273 ¦ Final
deserialization step: callBy() and creating objects using
reflection 277
10.3 Summary 281
CONTENTS
xiii
DSL construction 282
11.1 From APIs to DSLs
283
11.2
11.3
11.4
11.5
appendix A
appendix B
appendix C
The concept of domain-specific languages 284 • Internal
DSLs 285 • Structure of DSLs 286 • Building HTML with an
internal DSL 287
Building structured APIs: lambdas with receivers in DSLs
Lambdas with receivers and extension function types 288
Using lambdas with receivers in HTML builders 292
Kotlin builders: enabling abstraction and reuse 296
More flexible block nesting with the invoke convention
The invoke convention: objects callable as functions 299
The invoke convention and functional types 300 • The invoke
convention in DSLs: declaring dependencies in Gradle 301
Kotlin DSLs in practice 303
Chaining infix calls: should in test frameworks 303 • Defining
extensions on primitive types: handling dates 305 • Member
extension functions: internal DSL for SQL 306 • Anko: creating
Android UIs dynamically 309
Summary 310
Building Kotlin projects 313
Documenting Kotlin code 317
The Kotlin ecosystem 320
288
299
index 323
|
any_adam_object | 1 |
author | Jemerov, Dmitry Isakova, Svetlana |
author2 | Breslav, Andrey |
author2_role | aui |
author2_variant | a b ab |
author_GND | (DE-588)1130898210 (DE-588)1130898547 |
author_facet | Jemerov, Dmitry Isakova, Svetlana Breslav, Andrey |
author_role | aut aut |
author_sort | Jemerov, Dmitry |
author_variant | d j dj s i si |
building | Verbundindex |
bvnumber | BV044320300 |
callnumber-first | Q - Science |
callnumber-label | QA76 |
callnumber-raw | QA76.62 .J46 2017 |
callnumber-search | QA76.62 .J46 2017 |
callnumber-sort | QA 276.62 J46 42017 |
callnumber-subject | QA - Mathematics |
classification_rvk | ST 250 |
classification_tum | DAT 362f |
ctrlnum | (OCoLC)982134572 (DE-599)BVBBV044320300 |
dewey-full | 005.133 |
dewey-hundreds | 000 - Computer science, information, general works |
dewey-ones | 005 - Computer programming, programs, data, security |
dewey-raw | 005.133 |
dewey-search | 005.133 |
dewey-sort | 15.133 |
dewey-tens | 000 - Computer science, information, general works |
discipline | Informatik |
format | Book |
fullrecord | <?xml version="1.0" encoding="UTF-8"?><collection xmlns="http://www.loc.gov/MARC21/slim"><record><leader>01814nam a2200457 c 4500</leader><controlfield tag="001">BV044320300</controlfield><controlfield tag="003">DE-604</controlfield><controlfield tag="005">20191217 </controlfield><controlfield tag="007">t</controlfield><controlfield tag="008">170520s2017 |||| |||| 00||| eng d</controlfield><datafield tag="010" ind1=" " ind2=" "><subfield code="a">2017286272</subfield></datafield><datafield tag="020" ind1=" " ind2=" "><subfield code="a">1617293296</subfield><subfield code="c">pbk. : ca. EUR 29.95, US $ 44.99, CAN $ 51.99</subfield><subfield code="9">1-61729-329-6</subfield></datafield><datafield tag="020" ind1=" " ind2=" "><subfield code="a">9781617293290</subfield><subfield code="c">pbk.</subfield><subfield code="9">978-1-61729-329-0</subfield></datafield><datafield tag="035" ind1=" " ind2=" "><subfield code="a">(OCoLC)982134572</subfield></datafield><datafield tag="035" ind1=" " ind2=" "><subfield code="a">(DE-599)BVBBV044320300</subfield></datafield><datafield tag="040" ind1=" " ind2=" "><subfield code="a">DE-604</subfield><subfield code="b">ger</subfield><subfield code="e">rda</subfield></datafield><datafield tag="041" ind1="0" ind2=" "><subfield code="a">eng</subfield></datafield><datafield tag="049" ind1=" " ind2=" "><subfield code="a">DE-11</subfield><subfield code="a">DE-863</subfield><subfield code="a">DE-473</subfield><subfield code="a">DE-91G</subfield><subfield code="a">DE-83</subfield><subfield code="a">DE-573</subfield><subfield code="a">DE-92</subfield><subfield code="a">DE-703</subfield><subfield code="a">DE-860</subfield><subfield code="a">DE-898</subfield></datafield><datafield tag="050" ind1=" " ind2="0"><subfield code="a">QA76.62 .J46 2017</subfield></datafield><datafield tag="082" ind1="0" ind2=" "><subfield code="a">005.133</subfield><subfield code="2">23</subfield></datafield><datafield tag="084" ind1=" " ind2=" "><subfield code="a">ST 250</subfield><subfield code="0">(DE-625)143626:</subfield><subfield code="2">rvk</subfield></datafield><datafield tag="084" ind1=" " ind2=" "><subfield code="a">DAT 362f</subfield><subfield code="2">stub</subfield></datafield><datafield tag="100" ind1="1" ind2=" "><subfield code="a">Jemerov, Dmitry</subfield><subfield code="0">(DE-588)1130898210</subfield><subfield code="4">aut</subfield></datafield><datafield tag="245" ind1="1" ind2="0"><subfield code="a">Kotlin in action</subfield><subfield code="c">Dmitry Jemerov and Svetlana Isakova ; foreword by Andrey Breslav</subfield></datafield><datafield tag="264" ind1=" " ind2="1"><subfield code="a">Shelter Island, NY</subfield><subfield code="b">Manning</subfield><subfield code="c">[2017]</subfield></datafield><datafield tag="264" ind1=" " ind2="4"><subfield code="c">© 2017</subfield></datafield><datafield tag="300" ind1=" " ind2=" "><subfield code="a">xxv, 334 Seiten</subfield><subfield code="b">Diagramme</subfield></datafield><datafield tag="336" ind1=" " ind2=" "><subfield code="b">txt</subfield><subfield code="2">rdacontent</subfield></datafield><datafield tag="337" ind1=" " ind2=" "><subfield code="b">n</subfield><subfield code="2">rdamedia</subfield></datafield><datafield tag="338" ind1=" " ind2=" "><subfield code="b">nc</subfield><subfield code="2">rdacarrier</subfield></datafield><datafield tag="650" ind1=" " ind2="4"><subfield code="a">Kotlin (Computer program language)</subfield></datafield><datafield tag="650" ind1=" " ind2="4"><subfield code="a">Java (Computer program language)</subfield></datafield><datafield tag="650" ind1=" " ind2="4"><subfield code="a">Programming language</subfield></datafield><datafield tag="650" ind1=" " ind2="4"><subfield code="a">Functional programming (Computer science)</subfield></datafield><datafield tag="650" ind1="0" ind2="7"><subfield code="a">Kotlin</subfield><subfield code="g">Programmiersprache</subfield><subfield code="0">(DE-588)1136341129</subfield><subfield code="2">gnd</subfield><subfield code="9">rswk-swf</subfield></datafield><datafield tag="689" ind1="0" ind2="0"><subfield code="a">Kotlin</subfield><subfield code="g">Programmiersprache</subfield><subfield code="0">(DE-588)1136341129</subfield><subfield code="D">s</subfield></datafield><datafield tag="689" ind1="0" ind2=" "><subfield code="5">DE-604</subfield></datafield><datafield tag="700" ind1="1" ind2=" "><subfield code="a">Isakova, Svetlana</subfield><subfield code="0">(DE-588)1130898547</subfield><subfield code="4">aut</subfield></datafield><datafield tag="700" ind1="1" ind2=" "><subfield code="a">Breslav, Andrey</subfield><subfield code="4">aui</subfield></datafield><datafield tag="856" ind1="4" ind2="2"><subfield code="m">HBZ Datenaustausch</subfield><subfield code="q">application/pdf</subfield><subfield code="u">http://bvbr.bib-bvb.de:8991/F?func=service&doc_library=BVB01&local_base=BVB01&doc_number=029723784&sequence=000001&line_number=0001&func_code=DB_RECORDS&service_type=MEDIA</subfield><subfield code="3">Inhaltsverzeichnis</subfield></datafield><datafield tag="999" ind1=" " ind2=" "><subfield code="a">oai:aleph.bib-bvb.de:BVB01-029723784</subfield></datafield></record></collection> |
id | DE-604.BV044320300 |
illustrated | Not Illustrated |
indexdate | 2024-08-01T11:26:47Z |
institution | BVB |
isbn | 1617293296 9781617293290 |
language | English |
lccn | 2017286272 |
oai_aleph_id | oai:aleph.bib-bvb.de:BVB01-029723784 |
oclc_num | 982134572 |
open_access_boolean | |
owner | DE-11 DE-863 DE-BY-FWS DE-473 DE-BY-UBG DE-91G DE-BY-TUM DE-83 DE-573 DE-92 DE-703 DE-860 DE-898 DE-BY-UBR |
owner_facet | DE-11 DE-863 DE-BY-FWS DE-473 DE-BY-UBG DE-91G DE-BY-TUM DE-83 DE-573 DE-92 DE-703 DE-860 DE-898 DE-BY-UBR |
physical | xxv, 334 Seiten Diagramme |
publishDate | 2017 |
publishDateSearch | 2017 |
publishDateSort | 2017 |
publisher | Manning |
record_format | marc |
spellingShingle | Jemerov, Dmitry Isakova, Svetlana Kotlin in action Kotlin (Computer program language) Java (Computer program language) Programming language Functional programming (Computer science) Kotlin Programmiersprache (DE-588)1136341129 gnd |
subject_GND | (DE-588)1136341129 |
title | Kotlin in action |
title_auth | Kotlin in action |
title_exact_search | Kotlin in action |
title_full | Kotlin in action Dmitry Jemerov and Svetlana Isakova ; foreword by Andrey Breslav |
title_fullStr | Kotlin in action Dmitry Jemerov and Svetlana Isakova ; foreword by Andrey Breslav |
title_full_unstemmed | Kotlin in action Dmitry Jemerov and Svetlana Isakova ; foreword by Andrey Breslav |
title_short | Kotlin in action |
title_sort | kotlin in action |
topic | Kotlin (Computer program language) Java (Computer program language) Programming language Functional programming (Computer science) Kotlin Programmiersprache (DE-588)1136341129 gnd |
topic_facet | Kotlin (Computer program language) Java (Computer program language) Programming language Functional programming (Computer science) Kotlin Programmiersprache |
url | http://bvbr.bib-bvb.de:8991/F?func=service&doc_library=BVB01&local_base=BVB01&doc_number=029723784&sequence=000001&line_number=0001&func_code=DB_RECORDS&service_type=MEDIA |
work_keys_str_mv | AT jemerovdmitry kotlininaction AT isakovasvetlana kotlininaction AT breslavandrey kotlininaction |
Inhaltsverzeichnis
THWS Würzburg Teilbibliothek SHL, Raum I.2.11
Signatur: |
1340 ST 250 K76 J49 |
---|---|
Exemplar 1 | nicht ausleihbar Verfügbar Bestellen |