Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Kit de ferramenta no Kotlin

Kit de ferramenta no Kotlin

Apresentação para trabalhar com estrutura de dados utilizando Kotlin

segue o github do código da apresetação
https://github.com/rviannaoliveira/PresentationKitToolsKotlin

Avatar for Rodrigo Vianna Oliveira

Rodrigo Vianna Oliveira

August 01, 2017

Other Decks in Programming

Transcript

  1. Coleções em java • List • Set • Map •

    Collections • Iterable • ArrayList • LinkedList • HashSet • TreeSet • HashMap • TreeMap Interfaces Classes
  2. Kotlin "Immutable objects are particularly useful in concurrent applications. Since

    they cannot change state, they cannot be corrupted by thread interference or observed in an inconsistent state." https://docs.oracle.com/javase/tutorial/essential/concurrency/immutable.html
  3. Mutáveis ( Mutable ) • MutableIterable • MutableCollection • MutableList

    • MutableSet • MutableMap Imutáveis ( Immutable ) •Iterable •Collection •List •Set •Map Coleções
  4. Array val heroes = arrayOf("Captain America", "Iron Man", "Spider Man")

    heroes[2] = "Hulk" assertEquals("Hulk", heroes[2])
  5. Tipos de Functions Aggregate operations any all count fold/foldRight *forEach/forEachIndexed

    *max/maxBy min/minBy none reduce/reduceRight sumBy Filter operations drop/dropWhile/dropLastWhile *filter/filterNot/filterNotNull slice take/takeLast/takeWhile *distinct distinctBy Mapping operantions flatMap groupBy ap/mapIndexed/mapNotNul Generation operations merge partition *plus zip Ordering operations *reverse *sort/sortBy/sortDescending/sortDes
  6. Standard functions /** * Calls the specified function [block] with

    `this` value as its receiver and returns `this` value. */ @kotlin.internal.InlineOnly public inline fun <T> T.apply(block: T.() -> Unit): T { block(); return this } let with run apply also