....................................../////.===Shadow-Here===./////................................................ > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < ------------------------------------------------------------------------------------------------------------------- /////////////////////////////////////////////////////////////////////////////////////////////////////////////////// RIFF¤ WEBPVP8 ˜ ðÑ *ôô>‘HŸK¥¤"§£±¨àð enü¹%½_F‘åè¿2ºQú³íªú`N¿­3ÿƒügµJžaÿ¯ÿ°~¼ÎùnúîÞÖô•òíôÁÉß®Sm¥Ü/ ‡ó˜f£Ùà<˜„xëJ¢Ù€SO3x<ªÔ©4¿+ç¶A`q@Ì“Úñè™ÍÿJÌ´ª-˜ÆtÊÛL]Ïq*‘Ý”ì#ŸÌÏãY]@ê`¿ /ªfkØB4·®£ó z—Üw¥Pxù–ÞLШKÇN¾AkÙTf½è'‰g gÆv›Øuh~ a˜Z— ïj*á¥t d£“uÒ ¨`K˜¹ßþ]b>˜]_ÏÔ6W—è2r4x•íÖ…"ƒÖNîä!¦å Ú}ýxGøÌ —@ ;ÆÚŠ=ɾ1ý8lªË¥ô ^yf®Œ¢u&2©nÙÇ›ñÂñŒ³ aPo['½»øFùà­+4ê“$!lövlüÞ=;N®3ð‚õ›DÉKòÞ>ÄÍ ¥ˆuߤ#ˆ$6ù™¥îЇy’ÍB¼ çxÛ;X"WL£R÷͝*ó-¶Zu}º.s¸sšXqù–DþÿvªhüïwyŸ ¯é³lÀ:KCûÄ£Ëá\…­ ~—ýóî ¼ûûÜTÓüÇy…ŽÆvc»¾×U ñ¸žþоP÷¦ó:Ò¨¨5;Ð#&#ÖúñläÿÁœ GxÉ­/ñ‡áQðìYÉtÒw޼GÔ´zàÒò ð*ëzƒ•4~H]Ø‹f ñÓÈñ`NåWçs'ÆÏW^ø¹!XžµmQ5ÃËoLœÎ: ÞËÍ¥J ù…î èo£ßPÎñ¶ž8.Œ]ʵ~5›ÙË-ù*8ÙÖß±~ ©¹rÓê‚j¶d¸{^Q'˜±Crß ÚH—#¥¥QlÀ×ëã‡DÜ«èî þ&Çæžî;ŽÏºò6ÒLÃXy&ZŒ'j‚¢Ù€IßÚù+–MGi‰*jE€‘JcÜ ÓÌ EÏÚj]o˜ Þr <¾U ûŪæÍ/šÝH¥˜b”¼ ÁñßX GP›ï2›4WŠÏà×£…íÓk†¦H·ÅíMh–*nó÷à]ÁjCº€b7<ب‹¨5車bp2:Á[UªM„QŒçiNMa#<5›áËó¸HýÊ"…×Éw¹¦ì2º–x<›»a±¸3Weü®FÝ⑱ö–î–³|LPÈ~çð~Çå‡|º kD¢µÏàÆAI %1À% ¹Ò – ”ϝS¦‰4&¶£°à Öý”û_Ò Áw°A«Å€?mÇÛgHÉ/8)á¾ÛìáöŽP í¨PŸNÙµº¦‡§Ùš"ÿ«>+ªÕ`Ê÷‡‚ß Õû˜þãÇ-PÍ.¾XV‘€ dÜ"þ4¹ ±Oú‘©t¥¦FªÄÃÄ•b‚znýu½—#cDs˜ÃiÑOˆñ×QO=*IAÊ,¶ŽZƒ;‡wøXè%EÐk:F±Ú” .Ѽ+Áu&Ç`."pÈÉw o&¿dE6‘’EqTuK@Ì¥ã™À(Êk(h‰,H}RÀIXÛš3µ1©_OqÚÒJAñ$ÊÙÜ;D3çŒ[þùœh¬Ã³™ö6ç†NY".Ú‰ï[ªŸŒ '²Ð öø_¨ÂÉ9ué¶³ÒŠõTàîMØ#û¯gN‡bÙ놚X„ö …ÉeüÌ^J ‹€.œ$Æ)βÄeæW#óüßĺŸ€ ÀzwV 9oä»f4V*uB «Ë†¹ì¯žR霓æHXa=&“I4K;¯ç‹h×·"UŠ~<•╪Vêª&ÍSÃÆÅ?ÔqÎ*mTM ˜›µwêd#[C¡©§‘D<©àb†–ÁœøvH/,í:¯( ²£|4-„Æövv„Yͼ™^Á$ˆ„¢Û[6yB.åH*V¨æ?$=˜Ñ€•ñ·­(VlŸ‘ nÀt8W÷´Bûba?q9ú¶Xƒl«ÿ\ù¶’þòUÐj/õ¢Ìµ³g$ƒÎR!¸»|Oߍë’BhîÚÑ¢ñåŒJ„®„£2Ð3•ô02Nt…!£Í]Ïc½Qÿ?ˆ<&ÃA¾Ú,JˆijÌ#5yz„‰Î|ÊŽ5QÏ:‹ÐaóVÔxW—CpeÏzÐïíçôÿÅ_[hãsÐ_/ŽTÝ?BîˆííV$<¿i>²F¬_Eß¿ †bÊŒº­ÿ®Z H“C}”¬,Mp ý/Bá£w>˜YV°aƒúh+cŠ- r/[%|üUMHäQ°X»|û/@|°¥Ð !BÔ Ç¢Ä©š+Õì D«7ìN¶ŽðÔ " ƶ’ÖçtA‰Û×}{tþz­¾GÍ›k¹OEJR$ Â׃ «ëÁ"oÉôž$oUK(Ä)Ãz³Ê-‹êN[Ò3Œñbï8P 4ƒ×q¢bo|?<ÛX¬òÄͰL–±›(™ûG?ýË©ÚÄ–ÂDØÐ_Ç¡ô ¾–ÄÏø ×e8Ë©$ÄF¹Å‹ì[©óìl:F¾f´‹‹Xì²ï®\¬ôùƒ ÿat¥óèÒùHß0äe‚;ü×h:ÆWðHž=Ã8骣"kœ'Y?³}Tûè€>?0l›e1Lòñ„aæKÆw…hÖŠùW…ÈÆÄ0ši·›[pcwËþñiêíY/~-Á5˜!¿†A›™Mÿþ(±“t@â“ö2­´TG5yé]çå僳 .·ÍïçÝ7UÚ±Ð/Nè»,_Ï ùdj7\ï Wì4›„»c¸àešg#ÒÊ⥭áØo5‘?ÌdÝô¯ ¹kzsƒ=´#ëÉK›Ø´±-¥eW?‡çßtòTã…$Ý+qÿ±ƒ÷_3Ô¥í÷:æ–ž<·Ö‡‰Å¢ š‡%Ô—utÌÈìðžgÖÀz²À—ï÷Óîäõ{K'´È÷³yaÏÁjƒô}ž§®æÊydÕÈë5¯èˆõvÕ©ã*çD„ “z„Ó‡^^xÂ3M§A´JG‚öï 3W'ˆ.OvXè¡ÊÕª?5º7†˜(˜Ç¶#çê’¶!ÌdZK§æ 0fãaN]òY³RV ™î$®K2R¨`W!1Ôó\;Ý ýB%qæK•&ÓÈe9È0êI±žeŸß -ú@žQr¦ ö4»M¼Áè¹µmw 9 EÆE_°2ó„ŸXKWÁ×Hóì^´²GѝF©óäR†¦‰ç"V»eØ<3ùd3ÿÚ¤Žú“Gi" —‘_ÙËÎ~Üö¯¥½Î»üŸEÚŽåmÞþí ;ÞólËΦMzA"Âf(´òá;Éï(/7½ûñÌ­cïÕçлþÝz¾-ÍvÑ“pH­–ðÓj$¸Äû¤‚‘ãUBË-n“2åPkS5&‹Â|+g^œ®Ì͆d!OïäîU«c;{Û!ÅŽ«ëZ9Ókóˆ]¯ƒ›né `ÇÒ+tÆš (ØKá¾—=3œ®•vuMñg²\ï Ec€ 05±d™‡×iÇ×›UúvÌ¢£Èþ¡ÕØô¶ßÎA"ß±#Ö²ˆÊŸ¦*Ä~ij|àø.-¼'»Ú¥£h ofº¦‡VsR=N½„Î v˜Z*SÌ{=jÑB‹tê…;’HžH¯8–îDù8ñ¢|Q•bÛçš–‹m³“ê¨ åÏ^m¬Žãþ©ïêO‡½6] µÆ„Ooòü ²x}N¦Ë3ïé¿»€›HA˜m%çÞ/¿í7Fø“‹léUk)É°Œµ8Q8›:ÀŠeT*šõ~ôڝG6 ¢}`ùH­–”¡k ‰P1>š†®9z11!X wKfmÁ¦xÑ,N1Q”–æB¶M…ÒÃv6SMˆhU¬ÊPŽï‘öj=·CŒ¯u¹ƒVIЃsx4’ömÛýcå¡¶7ßŠß 57^\wÒÐÆ k§h,Œý î«q^R½3]J¸ÇðN ‚çU¬ôº^Áì} ³f©Õœ§ˆã:FÄÈ‚é(€™?àýÓüè1Gô£¼éj‚OÅñ  #>×—ßtà 0G¥Åa뀐kßhc™À_ÉñÞ#±)GD" YîäË-ÿÙ̪ ¹™a¯´¢E\ÝÒö‚;™„ë]_ p8‰o¡ñ+^÷ 3‘'dT4œŽ ðVë½° :¬víÑ«£tßÚS-3¶“þ2 †üüʨòrš¹M{É_¤`Û¨0ìjœøJ‡:÷ÃáZ˜†@GP&œÑDGÏs¡þ¦þDGú‘1Yá9Ôþ¼ ûø…§÷8&–ÜÑnÄ_m®^üÆ`;ÉVÁJ£?â€-ßê}suÍ2sõA NÌúA磸‘îÿÚ»ƒìö·á¿±tÑÐ"Tÿü˜[@/äj¬€uüªìù¥Ý˜á8Ý´sõj 8@rˆð äþZÇD®ÿUÏ2ùôõrBzÆÏÞž>Ì™xœ“ wiÎ×7_… ¸ \#€MɁV¶¥üÕÿPÔ9Z‡ø§É8#H:ƒ5ÀÝå9ÍIŒ5åKÙŠ÷qÄ>1AÈøžj"µÂд/ªnÀ qªã}"iŸBå˜ÓÛŽ¦…&ݧ;G@—³b¯“•"´4í¨ôM¨åñC‹ïùÉó¯ÓsSH2Ý@ßáM‡ˆKÀªÛUeø/4\gnm¥‹ŸŒ qÄ b9ÞwÒNÏ_4Ég³ú=܆‚´ •â¥õeíþkjz>éÚyU«Íӝ݃6"8/ø{=Ô¢»G¥ äUw°W«,ô—¿ãㆅү¢³xŠUû™yŒ (øSópÐ 9\åTâ»—*oG$/×ÍT†Y¿1¤Þ¢_‡ ¼ „±ÍçèSaÓ 3ÛMÁBkxs‰’R/¡¤ˆÙçª(*õ„üXÌ´ƒ E§´¬EF"Ù”R/ÐNyÆÂ^°?™6¡œïJ·±$§?º>ÖüœcNÌù¯G ‹ñ2ЁBB„^·úìaz¨k:#¨Æ¨8LÎõލ£^§S&cŒÐU€ü(‡F±Š¼&P>8ÙÁ ‰ p5?0ÊÆƒZl¸aô š¼¡}gÿ¶zÆC²¹¬ÎÖG*HB¡O<º2#ñŒAƒ–¡B˜´É$¥›É:FÀÔx¾u?XÜÏÓvN©RS{2ʈãk9rmP¼Qq̳ è¼ÐFׄ^¡Öì fE“F4A…!ì/…¦Lƒ… … $%´¾yã@CI¬ á—3PþBÏNÿ<ý°4Ü ËÃ#ØÍ~âW«rEñw‹eùMMHß²`¬Öó½íf³:‹k˜¯÷}Z!ã¿<¥,\#öµÀ¯aÒNÆIé,Ћ–lŽ#Àæ9ÀÒS·I’½-Ïp Äz¤Š Â* ­íÄ9­< h>׍3ZkËU¹§˜ŒŠ±f­’¤º³Q ÏB?‹#µíÃ¥®@(Gs«†vI¥Mµ‹Á©e~2ú³ÁP4ìÕi‚²Ê^ö@-DþÓàlÜOÍ]n"µã:žpsŽ¢:! Aõ.ç~ÓBûH÷JCÌ]õVƒd «ú´QÙEA–¯¯Œ!.ˆˆëQ±ù œ·Ì!Õâ )ùL„ÅÀlÚè5@B…o´Æ¸XÓ&Û…O«˜”_#‡ƒ„ûÈt!¤ÁÏ›ÎÝŠ?c9 â\>lÓÁVÄÑ™£eØY]:fÝ–—ù+p{™ðè û³”g±OƒÚSù£áÁÊ„ä,ï7š²G ÕÌBk)~ÑiCµ|h#u¤¶îK¨² #²vݯGãeÖ϶ú…¾múÀ¶þÔñ‚Š9'^($¤§ò “š½{éúp÷J›ušS¹áªCÂubÃH9™D™/ZöØÁ‡¦ÝÙŸ·kð*_”.C‹{áXó€‡c¡c€§/šò/&éš÷,àéJþ‰X›fµ“C¨œ®r¬"kL‰Â_q…Z–.ÉL~O µ›zn‚¹À¦Öª7\àHµšÖ %»ÇníV[¥*Õ;ƒ#½¾HK-ÖIÊdÏEÚ#=o÷Óò³´Š: Ç?{¾+9›–‘OEáU·S€˜j"ÄaÜ ŒÛWt› á–c#a»pÔZÞdŽtWê=9éöÊ¢µ~ ë ;Öe‡Œ®:bî3±ýê¢wà¼îpêñ¹¾4 zc¾ðÖÿzdêŒÑÒŝÀ‰s6¤í³ÎÙB¿OZ”+F¤á‡3@Ñëäg©·Ž ˆèª<ù@É{&S„œÕúÀA)‰h:YÀ5^ÂÓŒ°õäU\ ùËÍû#²?Xe¬tu‰^zÒÔãë¼ÛWtEtû …‚g¶Úüâî*moGè¨7%u!]PhÏd™Ý%Îx: VÒ¦ôÊD3ÀŽKÛËãvÆî…N¯ä>Eró–ð`5 Œ%u5XkñÌ*NU%¶áœÊ:Qÿú»“úzyÏ6å-၇¾ ´ ÒÊ]y žO‘w2Äøæ…H’²f±ÎÇ.ª|¥'gîV•Ü .̘¯€šòü¤U~Ù†*¢!?ò wý,}´°ÔÞnïoKq5µb!áÓ3"vAßH¡³¡·G(ÐÎ0Îò¼MG!/ài®@—¬04*`…«é8ªøøló“ˆÊ”èù¤…ßÊoÿé'ËuÌÖ5×È¡§ˆˆfŽë9}hìâ_!!¯  B&Ëö¶‰ÀAÙNVŸ Wh›¸®XÑJì¨ú“¿÷3uj²˜¨ÍÎìë±aúŠÝå¯ð*Ó¨ôJ“yºØ)m°WýOè68†ŸÏ2—‰Ïüꪫٚ¥‹l1 ø ÏÄFjêµvÌbü¦èÝx:X±¢H=MÐß—,ˆÉÇ´(9ú¾^ÅÚ4¿m‡$âX‘å%(AlZo@½¨UOÌÕ”1ø¸jÎÀÃÃ_ µ‘Ü.œº¦Ut: Æï’!=¯uwû#,“pþÇúŒø(é@?³ü¥‘Mo §—s@Œ#)§ŒùkL}NOÆêA›¸~r½¼ÙA—HJ«eˆÖ´*¡ÓpÌŸö.m<-"³ûÈ$¬_6­åf£ïÚâj1y§ÕJ½@dÞÁr&Í\Z%D£Íñ·AZ Û³øüd/ªAi†/Й~  ‡âĮҮÏh§°b—›Û«mJžòG'[ÈYýŒ¦9psl ýÁ ®±f¦x,‰½tN ‚Xª9 ÙÖH.«Lo0×?͹m¡å†Ѽ+›2ƒF ±Ê8 7Hցϓ²Æ–m9…òŸï]Â1äN†VLâCˆU .ÿ‰Ts +ÅÎx(%¦u]6AF Š ØF鈄‘ |¢¶c±soŒ/t[a¾–û:s·`i햍ê›ËchÈ…8ßÀUÜewŒðNOƒõD%q#éû\9¤x¹&UE×G¥ Í—™$ð E6-‡¼!ýpãÔM˜ Âsìe¯ñµK¢Ç¡ùôléœ4Ö£”À Š®Ðc ^¨À}ÙËŸ§›ºê{ÊuÉC ×Sr€¤’fÉ*j!úÓ’Gsùìoîßîn%ò· àc Wp÷$¨˜)û»H ×8ŽÒ€Zj¤3ÀÙºY'Ql¦py{-6íÔCeiØp‘‡XÊîÆUߢ܂ž£Xé¼Y8þ©ëgñß}é.ÎógÒ„ÃØËø¯»™§Xýy M%@NŠ À(~áÐvu7&•,Ù˜ó€uP‡^^®=_E„jt’ 403WebShell
403Webshell
Server IP : 104.19.154.92  /  Your IP : 216.73.216.47
Web Server : Apache
System : Linux lon12.onrocket.com 4.18.0-513.9.1.lve.el8.x86_64 #1 SMP Mon Dec 4 15:01:22 UTC 2023 x86_64
User : gd5hzp4 ( 1069)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/gd5hzp4/public_html/wp-content/plugins/wp-file-manager/lib/codemirror/mode/clike/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/gd5hzp4/public_html/wp-content/plugins/wp-file-manager/lib/codemirror/mode/clike/scala.html
<!doctype html>

<title>CodeMirror: Scala mode</title>
<meta charset="utf-8"/>
<link rel=stylesheet href="../../doc/docs.css">

<link rel="stylesheet" href="../../lib/codemirror.css">
<link rel="stylesheet" href="../../theme/ambiance.css">
<script src="../../lib/codemirror.js"></script>
<script src="../../addon/edit/matchbrackets.js"></script>
<script src="clike.js"></script>
<div id=nav>
  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>

  <ul>
    <li><a href="../../index.html">Home</a>
    <li><a href="../../doc/manual.html">Manual</a>
    <li><a href="https://github.com/codemirror/codemirror">Code</a>
  </ul>
  <ul>
    <li><a href="../index.html">Language modes</a>
    <li><a class=active href="#">Scala</a>
  </ul>
</div>

<article>
<h2>Scala mode</h2>
<form>
<textarea id="code" name="code">

  /*                     __                                               *\
  **     ________ ___   / /  ___     Scala API                            **
  **    / __/ __// _ | / /  / _ |    (c) 2003-2011, LAMP/EPFL             **
  **  __\ \/ /__/ __ |/ /__/ __ |    http://scala-lang.org/               **
  ** /____/\___/_/ |_/____/_/ | |                                         **
  **                          |/                                          **
  \*                                                                      */

  package scala.collection

  import generic._
  import mutable.{ Builder, ListBuffer }
  import annotation.{tailrec, migration, bridge}
  import annotation.unchecked.{ uncheckedVariance => uV }
  import parallel.ParIterable

  /** A template trait for traversable collections of type `Traversable[A]`.
   *  
   *  $traversableInfo
   *  @define mutability
   *  @define traversableInfo
   *  This is a base trait of all kinds of $mutability Scala collections. It
   *  implements the behavior common to all collections, in terms of a method
   *  `foreach` with signature:
   * {{{
   *     def foreach[U](f: Elem => U): Unit
   * }}}
   *  Collection classes mixing in this trait provide a concrete 
   *  `foreach` method which traverses all the
   *  elements contained in the collection, applying a given function to each.
   *  They also need to provide a method `newBuilder`
   *  which creates a builder for collections of the same kind.
   *  
   *  A traversable class might or might not have two properties: strictness
   *  and orderedness. Neither is represented as a type.
   *  
   *  The instances of a strict collection class have all their elements
   *  computed before they can be used as values. By contrast, instances of
   *  a non-strict collection class may defer computation of some of their
   *  elements until after the instance is available as a value.
   *  A typical example of a non-strict collection class is a
   *  <a href="../immutable/Stream.html" target="ContentFrame">
   *  `scala.collection.immutable.Stream`</a>.
   *  A more general class of examples are `TraversableViews`.
   *  
   *  If a collection is an instance of an ordered collection class, traversing
   *  its elements with `foreach` will always visit elements in the
   *  same order, even for different runs of the program. If the class is not
   *  ordered, `foreach` can visit elements in different orders for
   *  different runs (but it will keep the same order in the same run).'
   * 
   *  A typical example of a collection class which is not ordered is a
   *  `HashMap` of objects. The traversal order for hash maps will
   *  depend on the hash codes of its elements, and these hash codes might
   *  differ from one run to the next. By contrast, a `LinkedHashMap`
   *  is ordered because it's `foreach` method visits elements in the
   *  order they were inserted into the `HashMap`.
   *
   *  @author Martin Odersky
   *  @version 2.8
   *  @since   2.8
   *  @tparam A    the element type of the collection
   *  @tparam Repr the type of the actual collection containing the elements.
   *
   *  @define Coll Traversable
   *  @define coll traversable collection
   */
  trait TraversableLike[+A, +Repr] extends HasNewBuilder[A, Repr] 
                                      with FilterMonadic[A, Repr]
                                      with TraversableOnce[A]
                                      with GenTraversableLike[A, Repr]
                                      with Parallelizable[A, ParIterable[A]]
  {
    self =>

    import Traversable.breaks._

    /** The type implementing this traversable */
    protected type Self = Repr

    /** The collection of type $coll underlying this `TraversableLike` object.
     *  By default this is implemented as the `TraversableLike` object itself,
     *  but this can be overridden.
     */
    def repr: Repr = this.asInstanceOf[Repr]

    /** The underlying collection seen as an instance of `$Coll`.
     *  By default this is implemented as the current collection object itself,
     *  but this can be overridden.
     */
    protected[this] def thisCollection: Traversable[A] = this.asInstanceOf[Traversable[A]]

    /** A conversion from collections of type `Repr` to `$Coll` objects.
     *  By default this is implemented as just a cast, but this can be overridden.
     */
    protected[this] def toCollection(repr: Repr): Traversable[A] = repr.asInstanceOf[Traversable[A]]

    /** Creates a new builder for this collection type.
     */
    protected[this] def newBuilder: Builder[A, Repr]

    protected[this] def parCombiner = ParIterable.newCombiner[A]

    /** Applies a function `f` to all elements of this $coll.
     *  
     *    Note: this method underlies the implementation of most other bulk operations.
     *    It's important to implement this method in an efficient way.
     *  
     *
     *  @param  f   the function that is applied for its side-effect to every element.
     *              The result of function `f` is discarded.
     *              
     *  @tparam  U  the type parameter describing the result of function `f`. 
     *              This result will always be ignored. Typically `U` is `Unit`,
     *              but this is not necessary.
     *
     *  @usecase def foreach(f: A => Unit): Unit
     */
    def foreach[U](f: A => U): Unit

    /** Tests whether this $coll is empty.
     *
     *  @return    `true` if the $coll contain no elements, `false` otherwise.
     */
    def isEmpty: Boolean = {
      var result = true
      breakable {
        for (x <- this) {
          result = false
          break
        }
      }
      result
    }

    /** Tests whether this $coll is known to have a finite size.
     *  All strict collections are known to have finite size. For a non-strict collection
     *  such as `Stream`, the predicate returns `true` if all elements have been computed.
     *  It returns `false` if the stream is not yet evaluated to the end.
     *
     *  Note: many collection methods will not work on collections of infinite sizes. 
     *
     *  @return  `true` if this collection is known to have finite size, `false` otherwise.
     */
    def hasDefiniteSize = true

    def ++[B >: A, That](that: GenTraversableOnce[B])(implicit bf: CanBuildFrom[Repr, B, That]): That = {
      val b = bf(repr)
      if (that.isInstanceOf[IndexedSeqLike[_, _]]) b.sizeHint(this, that.seq.size)
      b ++= thisCollection
      b ++= that.seq
      b.result
    }

    @bridge
    def ++[B >: A, That](that: TraversableOnce[B])(implicit bf: CanBuildFrom[Repr, B, That]): That =
      ++(that: GenTraversableOnce[B])(bf)

    /** Concatenates this $coll with the elements of a traversable collection.
     *  It differs from ++ in that the right operand determines the type of the
     *  resulting collection rather than the left one.
     * 
     *  @param that   the traversable to append.
     *  @tparam B     the element type of the returned collection. 
     *  @tparam That  $thatinfo
     *  @param bf     $bfinfo
     *  @return       a new collection of type `That` which contains all elements
     *                of this $coll followed by all elements of `that`.
     * 
     *  @usecase def ++:[B](that: TraversableOnce[B]): $Coll[B]
     *  
     *  @return       a new $coll which contains all elements of this $coll
     *                followed by all elements of `that`.
     */
    def ++:[B >: A, That](that: TraversableOnce[B])(implicit bf: CanBuildFrom[Repr, B, That]): That = {
      val b = bf(repr)
      if (that.isInstanceOf[IndexedSeqLike[_, _]]) b.sizeHint(this, that.size)
      b ++= that
      b ++= thisCollection
      b.result
    }

    /** This overload exists because: for the implementation of ++: we should reuse
     *  that of ++ because many collections override it with more efficient versions.
     *  Since TraversableOnce has no '++' method, we have to implement that directly,
     *  but Traversable and down can use the overload.
     */
    def ++:[B >: A, That](that: Traversable[B])(implicit bf: CanBuildFrom[Repr, B, That]): That =
      (that ++ seq)(breakOut)

    def map[B, That](f: A => B)(implicit bf: CanBuildFrom[Repr, B, That]): That = {
      val b = bf(repr)
      b.sizeHint(this) 
      for (x <- this) b += f(x)
      b.result
    }

    def flatMap[B, That](f: A => GenTraversableOnce[B])(implicit bf: CanBuildFrom[Repr, B, That]): That = {
      val b = bf(repr)
      for (x <- this) b ++= f(x).seq
      b.result
    }

    /** Selects all elements of this $coll which satisfy a predicate.
     *
     *  @param p     the predicate used to test elements.
     *  @return      a new $coll consisting of all elements of this $coll that satisfy the given
     *               predicate `p`. The order of the elements is preserved.
     */
    def filter(p: A => Boolean): Repr = {
      val b = newBuilder
      for (x <- this) 
        if (p(x)) b += x
      b.result
    }

    /** Selects all elements of this $coll which do not satisfy a predicate.
     *
     *  @param p     the predicate used to test elements.
     *  @return      a new $coll consisting of all elements of this $coll that do not satisfy the given
     *               predicate `p`. The order of the elements is preserved.
     */
    def filterNot(p: A => Boolean): Repr = filter(!p(_))

    def collect[B, That](pf: PartialFunction[A, B])(implicit bf: CanBuildFrom[Repr, B, That]): That = {
      val b = bf(repr)
      for (x <- this) if (pf.isDefinedAt(x)) b += pf(x)
      b.result
    }

    /** Builds a new collection by applying an option-valued function to all
     *  elements of this $coll on which the function is defined.
     *
     *  @param f      the option-valued function which filters and maps the $coll.
     *  @tparam B     the element type of the returned collection.
     *  @tparam That  $thatinfo
     *  @param bf     $bfinfo
     *  @return       a new collection of type `That` resulting from applying the option-valued function
     *                `f` to each element and collecting all defined results.
     *                The order of the elements is preserved.
     *
     *  @usecase def filterMap[B](f: A => Option[B]): $Coll[B]
     *  
     *  @param pf     the partial function which filters and maps the $coll.
     *  @return       a new $coll resulting from applying the given option-valued function
     *                `f` to each element and collecting all defined results.
     *                The order of the elements is preserved.
    def filterMap[B, That](f: A => Option[B])(implicit bf: CanBuildFrom[Repr, B, That]): That = {
      val b = bf(repr)
      for (x <- this) 
        f(x) match {
          case Some(y) => b += y
          case _ =>
        }
      b.result
    }
     */

    /** Partitions this $coll in two ${coll}s according to a predicate.
     *
     *  @param p the predicate on which to partition.
     *  @return  a pair of ${coll}s: the first $coll consists of all elements that 
     *           satisfy the predicate `p` and the second $coll consists of all elements
     *           that don't. The relative order of the elements in the resulting ${coll}s
     *           is the same as in the original $coll.
     */
    def partition(p: A => Boolean): (Repr, Repr) = {
      val l, r = newBuilder
      for (x <- this) (if (p(x)) l else r) += x
      (l.result, r.result)
    }

    def groupBy[K](f: A => K): immutable.Map[K, Repr] = {
      val m = mutable.Map.empty[K, Builder[A, Repr]]
      for (elem <- this) {
        val key = f(elem)
        val bldr = m.getOrElseUpdate(key, newBuilder)
        bldr += elem
      }
      val b = immutable.Map.newBuilder[K, Repr]
      for ((k, v) <- m)
        b += ((k, v.result))

      b.result
    }

    /** Tests whether a predicate holds for all elements of this $coll.
     *
     *  $mayNotTerminateInf
     *
     *  @param   p     the predicate used to test elements.
     *  @return        `true` if the given predicate `p` holds for all elements
     *                 of this $coll, otherwise `false`.
     */
    def forall(p: A => Boolean): Boolean = {
      var result = true
      breakable {
        for (x <- this)
          if (!p(x)) { result = false; break }
      }
      result
    }

    /** Tests whether a predicate holds for some of the elements of this $coll.
     *
     *  $mayNotTerminateInf
     *
     *  @param   p     the predicate used to test elements.
     *  @return        `true` if the given predicate `p` holds for some of the
     *                 elements of this $coll, otherwise `false`.
     */
    def exists(p: A => Boolean): Boolean = {
      var result = false
      breakable {
        for (x <- this)
          if (p(x)) { result = true; break }
      }
      result
    }

    /** Finds the first element of the $coll satisfying a predicate, if any.
     * 
     *  $mayNotTerminateInf
     *  $orderDependent
     *
     *  @param p    the predicate used to test elements.
     *  @return     an option value containing the first element in the $coll
     *              that satisfies `p`, or `None` if none exists.
     */
    def find(p: A => Boolean): Option[A] = {
      var result: Option[A] = None
      breakable {
        for (x <- this)
          if (p(x)) { result = Some(x); break }
      }
      result
    }

    def scan[B >: A, That](z: B)(op: (B, B) => B)(implicit cbf: CanBuildFrom[Repr, B, That]): That = scanLeft(z)(op)

    def scanLeft[B, That](z: B)(op: (B, A) => B)(implicit bf: CanBuildFrom[Repr, B, That]): That = {
      val b = bf(repr)
      b.sizeHint(this, 1)
      var acc = z
      b += acc
      for (x <- this) { acc = op(acc, x); b += acc }
      b.result
    }

    @migration(2, 9,
      "This scanRight definition has changed in 2.9.\n" +
      "The previous behavior can be reproduced with scanRight.reverse."
    )
    def scanRight[B, That](z: B)(op: (A, B) => B)(implicit bf: CanBuildFrom[Repr, B, That]): That = {
      var scanned = List(z)
      var acc = z
      for (x <- reversed) {
        acc = op(x, acc)
        scanned ::= acc
      }
      val b = bf(repr)
      for (elem <- scanned) b += elem
      b.result
    }

    /** Selects the first element of this $coll.
     *  $orderDependent
     *  @return  the first element of this $coll.
     *  @throws `NoSuchElementException` if the $coll is empty.
     */
    def head: A = {
      var result: () => A = () => throw new NoSuchElementException
      breakable {
        for (x <- this) {
          result = () => x
          break
        }
      }
      result()
    }

    /** Optionally selects the first element.
     *  $orderDependent
     *  @return  the first element of this $coll if it is nonempty, `None` if it is empty.
     */
    def headOption: Option[A] = if (isEmpty) None else Some(head)

    /** Selects all elements except the first.
     *  $orderDependent
     *  @return  a $coll consisting of all elements of this $coll
     *           except the first one.
     *  @throws `UnsupportedOperationException` if the $coll is empty.
     */ 
    override def tail: Repr = {
      if (isEmpty) throw new UnsupportedOperationException("empty.tail")
      drop(1)
    }

    /** Selects the last element.
      * $orderDependent
      * @return The last element of this $coll.
      * @throws NoSuchElementException If the $coll is empty.
      */
    def last: A = {
      var lst = head
      for (x <- this)
        lst = x
      lst
    }

    /** Optionally selects the last element.
     *  $orderDependent
     *  @return  the last element of this $coll$ if it is nonempty, `None` if it is empty.
     */
    def lastOption: Option[A] = if (isEmpty) None else Some(last)

    /** Selects all elements except the last.
     *  $orderDependent
     *  @return  a $coll consisting of all elements of this $coll
     *           except the last one.
     *  @throws `UnsupportedOperationException` if the $coll is empty.
     */
    def init: Repr = {
      if (isEmpty) throw new UnsupportedOperationException("empty.init")
      var lst = head
      var follow = false
      val b = newBuilder
      b.sizeHint(this, -1)
      for (x <- this.seq) {
        if (follow) b += lst
        else follow = true
        lst = x
      }
      b.result
    }

    def take(n: Int): Repr = slice(0, n)

    def drop(n: Int): Repr = 
      if (n <= 0) {
        val b = newBuilder
        b.sizeHint(this)
        b ++= thisCollection result
      }
      else sliceWithKnownDelta(n, Int.MaxValue, -n)

    def slice(from: Int, until: Int): Repr = sliceWithKnownBound(math.max(from, 0), until)

    // Precondition: from >= 0, until > 0, builder already configured for building.
    private[this] def sliceInternal(from: Int, until: Int, b: Builder[A, Repr]): Repr = {
      var i = 0
      breakable {
        for (x <- this.seq) {
          if (i >= from) b += x
          i += 1
          if (i >= until) break
        }
      }
      b.result
    }
    // Precondition: from >= 0
    private[scala] def sliceWithKnownDelta(from: Int, until: Int, delta: Int): Repr = {
      val b = newBuilder
      if (until <= from) b.result
      else {
        b.sizeHint(this, delta)
        sliceInternal(from, until, b)
      }
    }
    // Precondition: from >= 0
    private[scala] def sliceWithKnownBound(from: Int, until: Int): Repr = {
      val b = newBuilder
      if (until <= from) b.result
      else {
        b.sizeHintBounded(until - from, this)      
        sliceInternal(from, until, b)
      }
    }

    def takeWhile(p: A => Boolean): Repr = {
      val b = newBuilder
      breakable {
        for (x <- this) {
          if (!p(x)) break
          b += x
        }
      }
      b.result
    }

    def dropWhile(p: A => Boolean): Repr = {
      val b = newBuilder
      var go = false
      for (x <- this) {
        if (!p(x)) go = true
        if (go) b += x
      }
      b.result
    }

    def span(p: A => Boolean): (Repr, Repr) = {
      val l, r = newBuilder
      var toLeft = true
      for (x <- this) {
        toLeft = toLeft && p(x)
        (if (toLeft) l else r) += x
      }
      (l.result, r.result)
    }

    def splitAt(n: Int): (Repr, Repr) = {
      val l, r = newBuilder
      l.sizeHintBounded(n, this)
      if (n >= 0) r.sizeHint(this, -n)
      var i = 0
      for (x <- this) {
        (if (i < n) l else r) += x
        i += 1
      }
      (l.result, r.result)
    }

    /** Iterates over the tails of this $coll. The first value will be this
     *  $coll and the final one will be an empty $coll, with the intervening
     *  values the results of successive applications of `tail`.
     *
     *  @return   an iterator over all the tails of this $coll
     *  @example  `List(1,2,3).tails = Iterator(List(1,2,3), List(2,3), List(3), Nil)`
     */  
    def tails: Iterator[Repr] = iterateUntilEmpty(_.tail)

    /** Iterates over the inits of this $coll. The first value will be this
     *  $coll and the final one will be an empty $coll, with the intervening
     *  values the results of successive applications of `init`.
     *
     *  @return  an iterator over all the inits of this $coll
     *  @example  `List(1,2,3).inits = Iterator(List(1,2,3), List(1,2), List(1), Nil)`
     */
    def inits: Iterator[Repr] = iterateUntilEmpty(_.init)

    /** Copies elements of this $coll to an array.
     *  Fills the given array `xs` with at most `len` elements of
     *  this $coll, starting at position `start`.
     *  Copying will stop once either the end of the current $coll is reached,
     *  or the end of the array is reached, or `len` elements have been copied.
     *
     *  $willNotTerminateInf
     * 
     *  @param  xs     the array to fill.
     *  @param  start  the starting index.
     *  @param  len    the maximal number of elements to copy.
     *  @tparam B      the type of the elements of the array. 
     * 
     *
     *  @usecase def copyToArray(xs: Array[A], start: Int, len: Int): Unit
     */
    def copyToArray[B >: A](xs: Array[B], start: Int, len: Int) {
      var i = start
      val end = (start + len) min xs.length
      breakable {
        for (x <- this) {
          if (i >= end) break
          xs(i) = x
          i += 1
        }
      }
    }

    def toTraversable: Traversable[A] = thisCollection
    def toIterator: Iterator[A] = toStream.iterator
    def toStream: Stream[A] = toBuffer.toStream

    /** Converts this $coll to a string.
     *
     *  @return   a string representation of this collection. By default this
     *            string consists of the `stringPrefix` of this $coll,
     *            followed by all elements separated by commas and enclosed in parentheses.
     */
    override def toString = mkString(stringPrefix + "(", ", ", ")")

    /** Defines the prefix of this object's `toString` representation.
     *
     *  @return  a string representation which starts the result of `toString`
     *           applied to this $coll. By default the string prefix is the
     *           simple name of the collection class $coll.
     */
    def stringPrefix : String = {
      var string = repr.asInstanceOf[AnyRef].getClass.getName
      val idx1 = string.lastIndexOf('.' : Int)
      if (idx1 != -1) string = string.substring(idx1 + 1)
      val idx2 = string.indexOf('$')
      if (idx2 != -1) string = string.substring(0, idx2)
      string
    }

    /** Creates a non-strict view of this $coll.
     * 
     *  @return a non-strict view of this $coll.
     */
    def view = new TraversableView[A, Repr] {
      protected lazy val underlying = self.repr
      override def foreach[U](f: A => U) = self foreach f
    }

    /** Creates a non-strict view of a slice of this $coll.
     *
     *  Note: the difference between `view` and `slice` is that `view` produces
     *        a view of the current $coll, whereas `slice` produces a new $coll.
     * 
     *  Note: `view(from, to)` is equivalent to `view.slice(from, to)`
     *  $orderDependent
     * 
     *  @param from   the index of the first element of the view
     *  @param until  the index of the element following the view
     *  @return a non-strict view of a slice of this $coll, starting at index `from`
     *  and extending up to (but not including) index `until`.
     */
    def view(from: Int, until: Int): TraversableView[A, Repr] = view.slice(from, until)

    /** Creates a non-strict filter of this $coll.
     *
     *  Note: the difference between `c filter p` and `c withFilter p` is that
     *        the former creates a new collection, whereas the latter only
     *        restricts the domain of subsequent `map`, `flatMap`, `foreach`,
     *        and `withFilter` operations.
     *  $orderDependent
     * 
     *  @param p   the predicate used to test elements.
     *  @return    an object of class `WithFilter`, which supports
     *             `map`, `flatMap`, `foreach`, and `withFilter` operations.
     *             All these operations apply to those elements of this $coll which
     *             satisfy the predicate `p`.
     */
    def withFilter(p: A => Boolean): FilterMonadic[A, Repr] = new WithFilter(p)

    /** A class supporting filtered operations. Instances of this class are
     *  returned by method `withFilter`.
     */
    class WithFilter(p: A => Boolean) extends FilterMonadic[A, Repr] {

      /** Builds a new collection by applying a function to all elements of the
       *  outer $coll containing this `WithFilter` instance that satisfy predicate `p`.
       *
       *  @param f      the function to apply to each element.
       *  @tparam B     the element type of the returned collection.
       *  @tparam That  $thatinfo
       *  @param bf     $bfinfo
       *  @return       a new collection of type `That` resulting from applying
       *                the given function `f` to each element of the outer $coll
       *                that satisfies predicate `p` and collecting the results.
       *
       *  @usecase def map[B](f: A => B): $Coll[B] 
       *  
       *  @return       a new $coll resulting from applying the given function
       *                `f` to each element of the outer $coll that satisfies
       *                predicate `p` and collecting the results.
       */
      def map[B, That](f: A => B)(implicit bf: CanBuildFrom[Repr, B, That]): That = {
        val b = bf(repr)
        for (x <- self) 
          if (p(x)) b += f(x)
        b.result
      }

      /** Builds a new collection by applying a function to all elements of the
       *  outer $coll containing this `WithFilter` instance that satisfy
       *  predicate `p` and concatenating the results. 
       *
       *  @param f      the function to apply to each element.
       *  @tparam B     the element type of the returned collection.
       *  @tparam That  $thatinfo
       *  @param bf     $bfinfo
       *  @return       a new collection of type `That` resulting from applying
       *                the given collection-valued function `f` to each element
       *                of the outer $coll that satisfies predicate `p` and
       *                concatenating the results.
       *
       *  @usecase def flatMap[B](f: A => TraversableOnce[B]): $Coll[B]
       * 
       *  @return       a new $coll resulting from applying the given collection-valued function
       *                `f` to each element of the outer $coll that satisfies predicate `p` and concatenating the results.
       */
      def flatMap[B, That](f: A => GenTraversableOnce[B])(implicit bf: CanBuildFrom[Repr, B, That]): That = {
        val b = bf(repr)
        for (x <- self) 
          if (p(x)) b ++= f(x).seq
        b.result
      }

      /** Applies a function `f` to all elements of the outer $coll containing
       *  this `WithFilter` instance that satisfy predicate `p`.
       *
       *  @param  f   the function that is applied for its side-effect to every element.
       *              The result of function `f` is discarded.
       *              
       *  @tparam  U  the type parameter describing the result of function `f`. 
       *              This result will always be ignored. Typically `U` is `Unit`,
       *              but this is not necessary.
       *
       *  @usecase def foreach(f: A => Unit): Unit
       */   
      def foreach[U](f: A => U): Unit = 
        for (x <- self) 
          if (p(x)) f(x)

      /** Further refines the filter for this $coll.
       *
       *  @param q   the predicate used to test elements.
       *  @return    an object of class `WithFilter`, which supports
       *             `map`, `flatMap`, `foreach`, and `withFilter` operations.
       *             All these operations apply to those elements of this $coll which
       *             satisfy the predicate `q` in addition to the predicate `p`.
       */
      def withFilter(q: A => Boolean): WithFilter = 
        new WithFilter(x => p(x) && q(x))
    }

    // A helper for tails and inits.
    private def iterateUntilEmpty(f: Traversable[A @uV] => Traversable[A @uV]): Iterator[Repr] = {
      val it = Iterator.iterate(thisCollection)(f) takeWhile (x => !x.isEmpty)
      it ++ Iterator(Nil) map (newBuilder ++= _ result)
    }
  }


</textarea>
</form>

    <script>
      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
        lineNumbers: true,
        matchBrackets: true,
        theme: "ambiance",
        mode: "text/x-scala"
      });
    </script>
  </article>

Youez - 2016 - github.com/yon3zu
LinuXploit