| 1 |
<!DOCTYPE html> |
| 2 |
<!-- |
| 3 |
~ Copyright (c) 2021 Rustam Mehmandarov |
| 4 |
~ All rights reserved. This program and the accompanying materials |
| 5 |
~ are made available under the terms of the Eclipse Public License v1.0 |
| 6 |
~ and Eclipse Distribution License v. 1.0 which accompany this distribution. |
| 7 |
~ The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html |
| 8 |
~ and the Eclipse Distribution License is available at |
| 9 |
~ http://www.eclipse.org/org/documents/edl-v10.php. |
| 10 |
--> |
| 11 |
|
| 12 |
<html lang="nb"> |
| 13 |
|
| 14 |
<head> |
| 15 |
|
| 16 |
<meta charset="utf-8"> |
| 17 |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> |
| 18 |
<meta name="viewport" content="width=device-width, initial-scale=1"> |
| 19 |
<meta name="description" content=""> |
| 20 |
<meta name="author" content=""> |
| 21 |
<link rel="shortcut icon" type="image/x-icon" href="../favicon.ico" /> |
| 22 |
|
| 23 |
<title>Eclipse Collections - Funksjoner du ønsker med samlingene du trenger. </title> |
| 24 |
|
| 25 |
<!-- Bootstrap Core CSS --> |
| 26 |
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" integrity="sha256-7s5uDGW3AHqw6xtJmNNtr+OBRJUlgkNJEo78P4b0yRw= sha512-nNo+yCHEyn0smMxSswnf/OnX6/KwJuZTlNZBjauKhTK0c+zT+q5JOCx0UFhXQ6rJR9jg6Es8gPuD2uZcYDLqSw==" crossorigin="anonymous"> |
| 27 |
|
| 28 |
<!-- Custom CSS --> |
| 29 |
<link href="../css/landing-page.css" rel="stylesheet"> |
| 30 |
|
| 31 |
<!-- Custom Fonts --> |
| 32 |
<link href="//fonts.googleapis.com/css?family=Roboto+Condensed:300,400,700,300italic,400italic,700italic" rel="stylesheet" type="text/css"> |
| 33 |
|
| 34 |
<!-- Google Code Prettify --> |
| 35 |
<link href="../css/sunburst.css" rel="stylesheet" type="text/css"> |
| 36 |
|
| 37 |
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> |
| 38 |
<!-- WARNING: Respond.js doesn't work if you view the page via file:// --> |
| 39 |
<!--[if lt IE 9]> |
| 40 |
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script> |
| 41 |
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script> |
| 42 |
<![endif]--> |
| 43 |
|
| 44 |
</head> |
| 45 |
|
| 46 |
<body> |
| 47 |
|
| 48 |
<!-- Navigation --> |
| 49 |
<nav class="navbar navbar-default navbar-fixed-top topnav" role="navigation"> |
| 50 |
<div class="container topnav"> |
| 51 |
<!-- Brand and toggle get grouped for better mobile display --> |
| 52 |
<div class="navbar-header"> |
| 53 |
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1"> |
| 54 |
<span class="sr-only">Toggle navigation</span> |
| 55 |
<span class="icon-bar"></span> |
| 56 |
<span class="icon-bar"></span> |
| 57 |
<span class="icon-bar"></span> |
| 58 |
</button> |
| 59 |
<img src="../img/eclipse-collections-logo.png" style="width:175px;height:50px;" align="left" alt="Eclipse Collections"> |
| 60 |
</div> |
| 61 |
<!-- Collect the nav links, forms, and other content for toggling --> |
| 62 |
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> |
| 63 |
<ul class="nav navbar-nav navbar-right"> |
| 64 |
<li> |
| 65 |
<a href="#start">Kom i gang</a> |
| 66 |
</li> |
| 67 |
<li> |
| 68 |
<a href="#concept">Konsepter</a> |
| 69 |
</li> |
| 70 |
<li> |
| 71 |
<a href="#learn">Lær</a> |
| 72 |
</li> |
| 73 |
<li> |
| 74 |
<a href="#history">Historikk</a> |
| 75 |
</li> |
| 76 |
<li> |
| 77 |
<a href="#refGuide">Veiledning</a> |
| 78 |
</li> |
| 79 |
<li> |
| 80 |
<a href="#sourceCode">Kildekode</a> |
| 81 |
</li> |
| 82 |
<li> |
| 83 |
<a href="#contribute">Bidra</a> |
| 84 |
</li> |
| 85 |
<li class="dropdown"> |
| 86 |
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" |
| 87 |
aria-expanded="false">Javadoc<span class="caret"></span></a> |
| 88 |
<ul class="dropdown-menu"> |
| 89 |
<li><a href="../javadoc/11.0.0">11.0.0</a></li> |
| 90 |
<li><a href="../javadoc/10.4.0">10.4.0</a></li> |
| 91 |
<li><a href="../javadoc/10.0.0">10.0.0</a></li> |
| 92 |
<li><a href="../javadoc/9.2.0">9.2.0</a></li> |
| 93 |
<li><a href="../javadoc/9.1.0">9.1.0</a></li> |
| 94 |
<li><a href="../javadoc/9.0.0">9.0.0</a></li> |
| 95 |
<li><a href="../javadoc/8.2.0">8.2.0</a></li> |
| 96 |
<li><a href="../javadoc/8.1.0">8.1.0</a></li> |
| 97 |
<li><a href="../javadoc/8.0.0">8.0.0</a></li> |
| 98 |
<li><a href="../javadoc/7.1.0">7.1.0</a></li> |
| 99 |
</ul> |
| 100 |
</li> |
| 101 |
<li class="dropdown"> |
| 102 |
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" |
| 103 |
aria-expanded="false">Språk<span class="caret"></span></a> |
| 104 |
<ul class="dropdown-menu"> |
| 105 |
<li><a href="../index.html">English</a></li> |
| 106 |
<li><a href="../de/index.html">Deutsch</a></li> |
| 107 |
<li><a href="../el/index.html">Ελληνικά</a></li> |
| 108 |
<li><a href="../es/index.html">Español</a></li> |
| 109 |
<li><a href="../cn/index.html">中文</a></li> |
| 110 |
<li><a href="../fr/index.html">Français</a></li> |
| 111 |
<li><a href="../ja/index.html">日本語</a></li> |
| 112 |
<li><a href="">Norsk (bokmål)</a></li> |
| 113 |
<li><a href="../pt-br/index.html">Português-Brasil</a></li> |
| 114 |
<li><a href="../ru/index.html">Русский</a></li> |
| 115 |
<li><a href="../hi/index.html">हिंदी</a></li> |
| 116 |
</ul> |
| 117 |
</li> |
| 118 |
</ul> |
| 119 |
</div> |
| 120 |
<!-- /.navbar-collapse --> |
| 121 |
</div> |
| 122 |
<!-- /.container --> |
| 123 |
</nav> |
| 124 |
|
| 125 |
|
| 126 |
<!-- Header --> |
| 127 |
<a class="anchor" name="about"></a> |
| 128 |
<div class="intro-header"> |
| 129 |
<div class="container-fluid"> |
| 130 |
|
| 131 |
<div class="row"> |
| 132 |
<div class="col-lg-push-2 col-lg-8"> |
| 133 |
<div class="intro-message"> |
| 134 |
<h1>Eclipse <span style="font-weight: 400">Collections</span></h1> |
| 135 |
<h3>- Funksjoner du ønsker med samlingene du trenger -</h3> |
| 136 |
</div> |
| 137 |
</div> |
| 138 |
</div> |
| 139 |
|
| 140 |
</div> |
| 141 |
<!-- /.container --> |
| 142 |
|
| 143 |
</div> |
| 144 |
<!-- /.intro-header --> |
| 145 |
|
| 146 |
<!-- Page Content --> |
| 147 |
|
| 148 |
<a class="anchor" name="start"></a> |
| 149 |
<div class="content-section-a"> |
| 150 |
|
| 151 |
<div class="container-fluid"> |
| 152 |
<div class="row"> |
| 153 |
<div class="col-lg-5 col-sm-6"> |
| 154 |
<hr class="section-heading-spacer"> |
| 155 |
<div class="clearfix"></div> |
| 156 |
<h2 class="section-heading">Kom i gang med <br>Eclipse Collections</h2> |
| 157 |
<p class="lead">Eclipse Collections er det beste rammeverket for Java-samlinger |
| 158 |
noensinne – det passer perfekt når du skal utvikle Java-koden din. |
| 159 |
<br><br>Integrer den i kodebasen din i dag med dine favorittbyggverktøy!</p> |
| 160 |
<object id="badge" data="https://snyk-widget.herokuapp.com/badge/mvn/org.eclipse.collections/eclipse-collections/badge.svg" type="image/svg+xml" style="vertical-align:middle"></object> |
| 161 |
<a href="http://search.maven.org/#search%7Cgav%7C1%7Cg:%22org.eclipse.collections%22%20AND%20a:%22eclipse-collections%22"><img src="https://maven-badges.herokuapp.com/maven-central/org.eclipse.collections/eclipse-collections/badge.svg"></a> |
| 162 |
<a href="https://github.com/eclipse/eclipse-collections/releases"><img src="https://img.shields.io/github/release/eclipse/eclipse-collections.svg"></a> |
| 163 |
<a href="https://github.com/eclipse/eclipse-collections/blob/master/LICENSE-EPL-1.0.txt"><img src="https://img.shields.io/badge/License-EPL-blue.svg"></a> |
| 164 |
<a href="https://github.com/eclipse/eclipse-collections/blob/master/LICENSE-EDL-1.0.txt"><img src="https://img.shields.io/badge/License-EDL-blue.svg"></a> |
| 165 |
</div> |
| 166 |
<div class="col-lg-7 col-sm-6"> |
| 167 |
<ul class="nav nav-tabs"> |
| 168 |
<li class="active"><a href="#maven" data-toggle="tab">Maven</a></li> |
| 169 |
<li><a href="#gradle" data-toggle="tab">Gradle</a></li> |
| 170 |
<li><a href="#ivy" data-toggle="tab">Ivy</a></li> |
| 171 |
<li><a href="#download" data-toggle="tab">Last ned</a></li> |
| 172 |
</ul> |
| 173 |
<div id="dependencies" class="tab-content"> |
| 174 |
<div class="tab-pane fade in active" id="maven"> |
| 175 |
<pre class="prettyprint"> |
| 176 |
<dependency> |
| 177 |
<groupId>org.eclipse.collections</groupId> |
| 178 |
<artifactId>eclipse-collections-api</artifactId> |
| 179 |
<version>11.0.0</version> |
| 180 |
</dependency> |
| 181 |
|
| 182 |
<dependency> |
| 183 |
<groupId>org.eclipse.collections</groupId> |
| 184 |
<artifactId>eclipse-collections</artifactId> |
| 185 |
<version>11.0.0</version> |
| 186 |
</dependency></pre> |
| 187 |
</div> |
| 188 |
<div class="tab-pane fade" id="gradle"> |
| 189 |
<pre class="prettyprint"> |
| 190 |
implementation 'org.eclipse.collections:eclipse-collections-api:11.0.0' |
| 191 |
implementation 'org.eclipse.collections:eclipse-collections:11.0.0'</pre> |
| 192 |
</div> |
| 193 |
<div class="tab-pane fade" id="ivy"> |
| 194 |
<pre class="prettyprint"> |
| 195 |
<dependency org="org.eclipse.collections" name="eclipse-collections-api" rev="11.0.0" /> |
| 196 |
<dependency org="org.eclipse.collections" name="eclipse-collections" rev="11.0.0" /></pre> |
| 197 |
</div> |
| 198 |
<div class="tab-pane fade" id="download"> |
| 199 |
<pre class="prettyprint"> |
| 200 |
<a target="_blank" href="http://mvnrepository.com/artifact/org.eclipse.collections/eclipse-collections-api/11.0.0">eclipse-collections-api-11.0.0.jar</a> |
| 201 |
<a target="_blank" href="http://mvnrepository.com/artifact/org.eclipse.collections/eclipse-collections/11.0.0">eclipse-collections-11.0.0.jar</a></pre> |
| 202 |
</div> |
| 203 |
|
| 204 |
</div> |
| 205 |
</div> |
| 206 |
</div> |
| 207 |
|
| 208 |
</div> |
| 209 |
<!-- /.container --> |
| 210 |
|
| 211 |
</div> |
| 212 |
<!-- Get Started --> |
| 213 |
|
| 214 |
<a class="anchor" name="concept"></a> |
| 215 |
<div class="content-section-b"> |
| 216 |
|
| 217 |
<div class="container-fluid"> |
| 218 |
|
| 219 |
<div class="row"> |
| 220 |
<div class="col-lg-push-7 col-lg-5 col-sm-push-6 col-sm-6"> |
| 221 |
<hr class="section-heading-spacer"> |
| 222 |
<div class="clearfix"></div> |
| 223 |
<h2 class="section-heading">Omfangsrike, konsise og lesbare API-er</h2> |
| 224 |
<p class="lead">Maksimer kraften til lambda-uttrykk og metodereferanser i Java 8 med omfangsrike API-er |
| 225 |
som er direkte tilgjengelige i samlingene dine. |
| 226 |
</p> |
| 227 |
</div> |
| 228 |
<div class="col-lg-pull-5 col-lg-7 col-sm-pull-6 col-sm-6"> |
| 229 |
<ul class="nav nav-tabs"> |
| 230 |
<li class="active"><a href="#method" data-toggle="tab">Eclipse Collections m/metodereferanser</a></li> |
| 231 |
<li><a href="#ec" data-toggle="tab">Eclipse Collections m/lambda-uttrykk</a></li> |
| 232 |
<li><a href="#streams" data-toggle="tab">Java 8 Streams</a></li> |
| 233 |
</ul> |
| 234 |
<div id="ec-vs-streams" class="tab-content"> |
| 235 |
<div class="tab-pane fade in active" id="method"> |
| 236 |
<pre class="prettyprint lang-java"> |
| 237 |
boolean anyPeopleHaveCats = |
| 238 |
this.people |
| 239 |
.anySatisfyWith(Person::hasPet, PetType.CAT); |
| 240 |
|
| 241 |
int countPeopleWithCats = |
| 242 |
this.people |
| 243 |
.countWith(Person::hasPet, PetType.CAT); |
| 244 |
|
| 245 |
MutableList<Person> peopleWithCats = |
| 246 |
this.people |
| 247 |
.selectWith(Person::hasPet, PetType.CAT)</pre> |
| 248 |
</div> |
| 249 |
<div class="tab-pane fade" id="ec"> |
| 250 |
<pre class="prettyprint lang-java"> |
| 251 |
boolean anyPeopleHaveCats = |
| 252 |
this.people |
| 253 |
.anySatisfy(person -> person.hasPet(PetType.CAT)); |
| 254 |
|
| 255 |
int countPeopleWithCats = |
| 256 |
this.people |
| 257 |
.count(person -> person.hasPet(PetType.CAT)); |
| 258 |
|
| 259 |
MutableList<Person> peopleWithCats = |
| 260 |
this.people |
| 261 |
.select(person -> person.hasPet(PetType.CAT));</pre> |
| 262 |
</div> |
| 263 |
<div class="tab-pane fade" id="streams"> |
| 264 |
<pre class="prettyprint lang-java"> |
| 265 |
boolean anyPeopleHaveCats = |
| 266 |
this.people |
| 267 |
.stream() |
| 268 |
.anyMatch(person -> person.hasPet(PetType.CAT)); |
| 269 |
|
| 270 |
long countPeopleWithCats = |
| 271 |
this.people |
| 272 |
.stream() |
| 273 |
.filter(person -> person.hasPet(PetType.CAT)) |
| 274 |
.count(); |
| 275 |
|
| 276 |
List<Person> peopleWithCats = |
| 277 |
this.people |
| 278 |
.stream() |
| 279 |
.filter(person -> person.hasPet(PetType.CAT)) |
| 280 |
.collect(Collectors.toList());</pre> |
| 281 |
</div> |
| 282 |
</div> |
| 283 |
<!-- /.tab-content --> |
| 284 |
</div> |
| 285 |
<!-- /.col --> |
| 286 |
</div> |
| 287 |
<!-- /.row --> |
| 288 |
|
| 289 |
</div> |
| 290 |
<!-- /.container --> |
| 291 |
|
| 292 |
</div> |
| 293 |
<!-- Rich and fluent API --> |
| 294 |
|
| 295 |
<div class="content-section-a"> |
| 296 |
|
| 297 |
<div class="container-fluid"> |
| 298 |
|
| 299 |
<div class="row"> |
| 300 |
<div class="col-lg-5 col-sm-6"> |
| 301 |
<hr class="section-heading-spacer"> |
| 302 |
<div class="clearfix"></div> |
| 303 |
<h2 class="section-heading">Mange containertyper, inkludert <br>uforanderlige samlinger, primitive samlinger, Bimap, Multimap og Bag</h2> |
| 304 |
<p class="lead">Uforanderlige (immutable) samlinger, samlinger av primitive typer, Bimap (omvendt ordbok hvor du kan finne en nøkkel etter verdi), |
| 305 |
Multimap (multi-ordbøker – ordbøker med ikke-unike nøkler) og Bag (flersett – et sett med gjentagende elementer) – du kan bruke alle |
| 306 |
disse typene containere ved bruk av praktiske og lett tilgjengelige factory-metoder.</p> |
| 307 |
</div> |
| 308 |
<div class="col-lg-7 col-sm-6"> |
| 309 |
<ul class="nav nav-tabs"> |
| 310 |
<li class="active"><a href="#mutable" data-toggle="tab">Muterbare samlinger</a></li> |
| 311 |
<li><a href="#immutable" data-toggle="tab">Uforanderlige samlinger</a></li> |
| 312 |
<li><a href="#primitives" data-toggle="tab">Primitive samlinger</a></li> |
| 313 |
</ul> |
| 314 |
<div id="container-types" class="tab-content"> |
| 315 |
<div class="tab-pane fade in active" id="mutable"> |
| 316 |
<pre class="prettyprint lang-java"> |
| 317 |
//Instansierer muterbar liste with empty()-, of()-, with()-metoder |
| 318 |
MutableList<String> mutableListEmpty = |
| 319 |
Lists.mutable.empty(); |
| 320 |
MutableList<String> mutableListOf = |
| 321 |
Lists.mutable.of("One", "One", "Two", "Three"); |
| 322 |
MutableList<String> mutableListWith = |
| 323 |
Lists.mutable.with("One", "One", "Two", "Three"); |
| 324 |
|
| 325 |
//Forskjellige container-typer som er tilgjengelige |
| 326 |
MutableSet<String> mutableSet = |
| 327 |
Sets.mutable.with("One", "One", "Two", "Three"); |
| 328 |
MutableBag<String> mutableBag = |
| 329 |
Bags.mutable.with("One", "One", "Two", "Three"); |
| 330 |
MutableStack<String> mutableStack = |
| 331 |
Stacks.mutable.with("One", "One", "Two", "Three"); |
| 332 |
MutableMap<String, String> mutableMap = |
| 333 |
Maps.mutable.with("key1", "value1", "key2", "value2", "key3", "value3"); |
| 334 |
MutableMultimap<String, String> multimapWithList = |
| 335 |
Multimaps.mutable.list.with("key1", "value1-1", "key1", "value1-2", "key2","value2-1"); |
| 336 |
MutableBiMap<String, String> mutableBiMap = |
| 337 |
BiMaps.mutable.with("key1", "value1", "key2", "value2", "key3", "value3");</pre> |
| 338 |
</div> |
| 339 |
<div class="tab-pane fade" id="immutable"> |
| 340 |
<pre class="prettyprint lang-java"> |
| 341 |
//Instansierer muterbar liste with empty()-, of()-, with()-metoder |
| 342 |
ImmutableList<String> immutableListEmpty = |
| 343 |
Lists.immutable.empty(); |
| 344 |
ImmutableList<String> immutableListOf = |
| 345 |
Lists.immutable.of("One", "One", "Two", "Three"); |
| 346 |
ImmutableList<String> immutableListWith = |
| 347 |
Lists.immutable.with("One", "One", "Two", "Three"); |
| 348 |
|
| 349 |
//Forskjellige container-typer som er tilgjengelige |
| 350 |
ImmutableSet<String> immutableSet = |
| 351 |
Sets.immutable.with("One", "One", "Two", "Three"); |
| 352 |
ImmutableBag<String> immutableBag = |
| 353 |
Bags.immutable.with("One", "One", "Two", "Three"); |
| 354 |
ImmutableStack<String> immutableStack = |
| 355 |
Stacks.immutable.with("One", "One", "Two", "Three"); |
| 356 |
ImmutableMap<String, String> immutableMap = |
| 357 |
Maps.immutable.with("key1", "value1", "key2", "value2", "key3", "value3"); |
| 358 |
ImmutableMultimap<String, String> immutableMultimapWithList = |
| 359 |
Multimaps.immutable.list.with("key1", "value1-1", "key1", "value1-2", "key2","value2-1"); |
| 360 |
ImmutableBiMap<String, String> immutableBiMap = |
| 361 |
BiMaps.immutable.with("key1", "value1", "key2", "value2", "key3", "value3");</pre> |
| 362 |
</div> |
| 363 |
<div class="tab-pane fade" id="primitives"> |
| 364 |
<pre class="prettyprint lang-java"> |
| 365 |
//Muterbare og uforanderlige lister, sett, Bags, Stacks og Maps er tilgjengelige for alle 8 primitive typer |
| 366 |
MutableIntList intList = |
| 367 |
IntLists.mutable.of(1, 2, 3); |
| 368 |
MutableLongList longList = |
| 369 |
LongLists.mutable.of(1L, 2L, 3L); |
| 370 |
MutableCharList charList = |
| 371 |
CharLists.mutable.of('a', 'b', 'c'); |
| 372 |
MutableShortList shortList = |
| 373 |
ShortLists.mutable.of((short)1, (short)2, (short)3); |
| 374 |
MutableByteList byteList = |
| 375 |
ByteLists.mutable.of((byte)1, (byte)2, (byte)3); |
| 376 |
MutableBooleanList booleanList = |
| 377 |
BooleanLists.mutable.of(true, false); |
| 378 |
MutableFloatList floatList = |
| 379 |
FloatLists.mutable.of(1.0f, 2.0f, 3.0f); |
| 380 |
MutableDoubleList doubleList = |
| 381 |
DoubleLists.mutable.of(1.0, 2.0, 3.0); |
| 382 |
|
| 383 |
//Du kan lage heltallslister med intervaller vha. IntInterval |
| 384 |
IntInterval oneTo10 = |
| 385 |
IntInterval.fromTo(1, 10); // heltall fra 1 til 10 |
| 386 |
// [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] |
| 387 |
IntInterval oneTo10By3 = |
| 388 |
IntInterval.fromToBy(1, 10, 3); // heltall fra 1 til 10 med steg 3 |
| 389 |
// [1, 4, 7, 10] |
| 390 |
IntInterval oddsFrom1To10 = |
| 391 |
IntInterval.oddsFromTo(1, 10); // oddetall fra 1 til 10 |
| 392 |
// [1, 3, 5, 7, 9] |
| 393 |
IntInterval evensFrom1To10 = |
| 394 |
IntInterval.evensFromTo(1, 10); // partall fra 1 til 10 |
| 395 |
// [2, 4, 6, 8, 10]</pre> |
| 396 |
</div> |
| 397 |
</div> |
| 398 |
<!-- /.tab-content --> |
| 399 |
</div> |
| 400 |
<!-- /.col --> |
| 401 |
</div> |
| 402 |
<!-- /.row --> |
| 403 |
|
| 404 |
</div> |
| 405 |
<!-- /.container --> |
| 406 |
|
| 407 |
</div> |
| 408 |
<!-- Container Types --> |
| 409 |
|
| 410 |
<a class="anchor" name="memory"></a> |
| 411 |
<div class="content-section-b"> |
| 412 |
|
| 413 |
<div class="container-fluid"> |
| 414 |
|
| 415 |
<div class="row"> |
| 416 |
<div class="col-lg-push-6 col-lg-6 col-sm-push-6 col-sm-6"> |
| 417 |
<hr class="section-heading-spacer"> |
| 418 |
<div class="clearfix"></div> |
| 419 |
<h2 class="section-heading">Reduser minnefotavtrykket <br>med minneeffektive containere</h2> |
| 420 |
<p class="lead">Eclipse Collections gir minneeffektiv implementasjon av Sets og Maps, samt primitive samlinger. </p> |
| 421 |
</div> |
| 422 |
<div class="col-lg-pull-6 col-lg-6 col-sm-pull-6 col-sm-6"> |
| 423 |
<ul class="nav nav-tabs"> |
| 424 |
<li class="active"><a href="#set" data-toggle="tab">Sets</a></li> |
| 425 |
<li><a href="#map" data-toggle="tab">Maps</a></li> |
| 426 |
<li><a href="#ints" data-toggle="tab">Primitive samlinger</a></li> |
| 427 |
</ul> |
| 428 |
<div id="memory" class="tab-content"> |
| 429 |
<div class="tab-pane fade in active" id="set"> |
| 430 |
<img class="img-responsive" src="../img/set.png" alt=""> |
| 431 |
</div> |
| 432 |
<div class="tab-pane fade" id="map"> |
| 433 |
<img class="img-responsive" src="../img/map.png" alt=""> |
| 434 |
</div> |
| 435 |
<div class="tab-pane fade" id="ints"> |
| 436 |
<img class="img-responsive" src="../img/ints.png" alt=""> |
| 437 |
</div> |
| 438 |
</div> |
| 439 |
</div> |
| 440 |
</div> |
| 441 |
|
| 442 |
</div> |
| 443 |
<!-- /.container --> |
| 444 |
|
| 445 |
</div> |
| 446 |
<!-- Memory footprint --> |
| 447 |
|
| 448 |
<a class="anchor" name="learn"></a> |
| 449 |
<div class="content-section-a"> |
| 450 |
|
| 451 |
<div class="container-fluid"> |
| 452 |
|
| 453 |
<div class="row"> |
| 454 |
<div class="col-lg-5 col-sm-6"> |
| 455 |
<hr class="section-heading-spacer"> |
| 456 |
<div class="clearfix"></div> |
| 457 |
<h2 class="section-heading">Lær Eclipse Collections med kodekata</h2> |
| 458 |
<p class="lead"> |
| 459 |
Ta en titt på <a href="https://github.com/eclipse/eclipse-collections-kata">Eclipse Collections Kata</a> – en gøy måte å hjelpe deg å lære |
| 460 |
den idiomatiske bruken av Eclipse Collections. Denne spesielle kataen er satt opp som en serie enhetstester som feiler. Din oppgave er å få dem til |
| 461 |
å passere ved hjelp av Eclipse Collections. |
| 462 |
</p> |
| 463 |
</div> |
| 464 |
<div class="col-lg-7 col-sm-6"> |
| 465 |
<ul class="nav nav-tabs"> |
| 466 |
<li class="active"><a href="#exercise" data-toggle="tab">Oppgaveeksempel</a></li> |
| 467 |
<li><a href="#solution" data-toggle="tab">Løsningsforslag</a></li> |
| 468 |
</ul> |
| 469 |
<div class="tab-content"> |
| 470 |
<div class="tab-pane fade in active" id="exercise"> |
| 471 |
<pre class="prettyprint lang-java"> |
| 472 |
@Test |
| 473 |
public void getFirstNamesOfAllPeople() |
| 474 |
{ |
| 475 |
MutableList<Person> people = this.people; |
| 476 |
MutableList<String> firstNames = null; //Replace null, with a transformation method on MutableList. |
| 477 |
MutableList<String> expectedFirstNames = |
| 478 |
Lists.mutable.with("Mary", "Bob", "Ted", "Jake", "Barry", "Terry", "Harry", "John"); |
| 479 |
Assert.assertEquals(expectedFirstNames, firstNames); |
| 480 |
}</pre> |
| 481 |
</div> |
| 482 |
<div class="tab-pane fade" id="solution"> |
| 483 |
<pre class="prettyprint lang-java"> |
| 484 |
@Test |
| 485 |
public void getFirstNamesOfAllPeople() |
| 486 |
{ |
| 487 |
MutableList<Person> people = this.people; |
| 488 |
MutableList<String> firstNames = people.collect(Person::getFirstName); |
| 489 |
MutableList<String> expectedFirstNames = |
| 490 |
Lists.mutable.with("Mary", "Bob", "Ted", "Jake", "Barry", "Terry", "Harry", "John"); |
| 491 |
Assert.assertEquals(expectedFirstNames, firstNames); |
| 492 |
}</pre> |
| 493 |
</div> |
| 494 |
</div> |
| 495 |
<!-- /.tab-content --> |
| 496 |
</div> |
| 497 |
<!-- /.col --> |
| 498 |
</div> |
| 499 |
<!-- /.row --> |
| 500 |
|
| 501 |
</div> |
| 502 |
<!-- /.container --> |
| 503 |
|
| 504 |
</div> |
| 505 |
<!-- Kata --> |
| 506 |
|
| 507 |
<a class="anchor" name="history"></a> |
| 508 |
<div class="content-section-b"> |
| 509 |
|
| 510 |
<div class="container-fluid"> |
| 511 |
|
| 512 |
<h2 class="section-heading">Historien til Eclipse Collections</h2> |
| 513 |
<p class="lead"> |
| 514 |
Opprinnelig startet Eclipse Collections som et samlingsrammeverk kalt Caramel på Goldman Sachs i 2004. |
| 515 |
|
| 516 |
Siden den gang har rammeverket utviklet seg, og i 2012 ble det lagt ut som åpen kiledekode på GitHub som et prosjekt kalt |
| 517 |
<a href="https://github.com/goldmansachs/gs-collections">GS Collections</a>. |
| 518 |
<br><br> |
| 519 |
GS Collections har blitt presentert på en rekke |
| 520 |
<a href="https://github.com/eclipse/eclipse-collections/wiki/Conference-talks-and-meetups">konferanser</a>, |
| 521 |
inkludert JVM Summit i 2012 og JavaOne i 2014. |
| 522 |
En sammenligning av ytelse mellom parallelle lazy implementasjoner i Java 8, Scala og GS Collections ble presentert på |
| 523 |
<a href="http://www.infoq.com/presentations/java-streams-scala-parallel-collections">QCon New York</a> i 2014. |
| 524 |
Videre ble <a href="https://github.com/eclipse/eclipse-collections/wiki/Articles">artikler</a> om GS Collections |
| 525 |
(<a href="http://www.infoq.com/articles/GS-Collections-by-Example-1">Del 1</a> / |
| 526 |
<a href="http://www.infoq.com/articles/GS-Collections-by-Example-2">Del 2</a>) |
| 527 |
publisert på InfoQ.com. |
| 528 |
Disse artiklene viser noen av funksjonene i rammeverket gjennom eksempler, samt et intervju med skaperen av GS Collections. |
| 529 |
<br><br> |
| 530 |
|
| 531 |
Gjennom årene har rundt 40 utviklere fra det samme selskapet bidratt til rammeverket. |
| 532 |
<br><br> |
| 533 |
|
| 534 |
For å utnytte fullt ut prosjektets potensiale som et åpen kildekode-prosjekt, ble GS Collections migrert til |
| 535 |
Eclipse Foundation og endret navn til Eclipse Collections i 2015. |
| 536 |
Nå er rammeverket helt åpent og aksepterer bidrag fra alle! |
| 537 |
</p> |
| 538 |
</div> |
| 539 |
</div> |
| 540 |
<!-- History --> |
| 541 |
|
| 542 |
<a class="anchor" name="refGuide"></a> |
| 543 |
<div class="content-section-a"> |
| 544 |
<div class="container-fluid"> |
| 545 |
<h2 class="section-heading">Veiledning</h2> |
| 546 |
<p class="lead"> |
| 547 |
En omfattende referansehåndbok for biblioteket er tilgjengelig på GitHub: |
| 548 |
<a href="https://github.com/eclipse/eclipse-collections/blob/master/docs/guide.md#eclipse-collections-reference-guide">Reference Guide</a>. |
| 549 |
</p> |
| 550 |
</div> |
| 551 |
<!-- /.container --> |
| 552 |
|
| 553 |
</div> |
| 554 |
<!-- Reference Guide --> |
| 555 |
|
| 556 |
<a class="anchor" name="sourceCode"></a> |
| 557 |
<div class="content-section-b"> |
| 558 |
<div class="container-fluid"> |
| 559 |
<h2 class="section-heading">Kildekode</h2> |
| 560 |
<p class="lead"> |
| 561 |
Kildekoden er tilgjengelig på GitHub: <a href="https://github.com/eclipse/eclipse-collections">Eclipse Collections</a>. |
| 562 |
</p> |
| 563 |
</div> |
| 564 |
<!-- /.container --> |
| 565 |
</div> |
| 566 |
<!-- Source Code --> |
| 567 |
|
| 568 |
<a class="anchor" name="contribute"></a> |
| 569 |
<div class="content-footer"> |
| 570 |
|
| 571 |
<div class="container-fluid"> |
| 572 |
|
| 573 |
<div class="row"> |
| 574 |
<div class="col-lg-4 col-sm-4"> |
| 575 |
<h3>Bidra</h3> |
| 576 |
<p class="regular"> |
| 577 |
Vi tar med glede imot bidrag! |
| 578 |
<br><br> |
| 579 |
Eclipse Collections Project Roadmap finner du <a href="https://github.com/eclipse/eclipse-collections/wiki/Roadmap">her</a>. |
| 580 |
<br><br> |
| 581 |
Vi godtar bidrag via pull-forespørsler på GitHub. |
| 582 |
Se <a href="https://github.com/eclipse/eclipse-collections/blob/master/CONTRIBUTING.md">denne artikkelen om hvordan du kan bidra</a> for å komme i gang. |
| 583 |
</p> |
| 584 |
</div> |
| 585 |
<div class="col-lg-4 col-sm-4"> |
| 586 |
<h3>Siste nytt</h3> |
| 587 |
<p class="regular">Eclipse Collections 11.0.0 <a href="https://github.com/eclipse/eclipse-collections/releases/tag/11.0.0">released</a> <a class="light">(Nov 23rd 2021)</a></p> |
| 588 |
<p class="regular">Eclipse Collections 10.4.0 <a href="https://github.com/eclipse/eclipse-collections/releases/tag/10.4.0">released</a> <a class="light">(Aug 20th 2020)</a></p> |
| 589 |
<p class="regular">Eclipse Collections 10.3.0 <a href="https://github.com/eclipse/eclipse-collections/releases/tag/10.3.0">released</a> <a class="light">(Aug 8th 2020)</a></p> |
| 590 |
<p class="regular">Eclipse Collections 10.2.0 <a href="https://github.com/eclipse/eclipse-collections/releases/tag/10.2.0">released</a> <a class="light">(Feb 11th 2020)</a></p> |
| 591 |
<p class="regular">Eclipse Collections 10.1.0 <a href="https://github.com/eclipse/eclipse-collections/releases/tag/10.1.0">released</a> <a class="light">(Dec 4th 2019)</a></p> |
| 592 |
<p class="regular">Eclipse Collections 10.0.0 <a href="https://github.com/eclipse/eclipse-collections/releases/tag/10.0.0">released</a> <a class="light">(Jul 10th 2019)</a></p> |
| 593 |
</div> |
| 594 |
<div class="col-lg-4 col-sm-4"> |
| 595 |
<h3>Nyttige lenker</h3> |
| 596 |
<p class="regular">Eclipse PMI: <a href="https://projects.eclipse.org/projects/technology.collections">eclipse project management infrastructure</a></p> |
| 597 |
<p class="regular">GitHub: <a href="https://github.com/eclipse/eclipse-collections">eclipse-collections</a></p> |
| 598 |
<p class="regular">Feilmeldinger og andre saker: <a href="https://github.com/eclipse/eclipse-collections/issues">GitHub issues</a></p> |
| 599 |
<p class="regular">Mailinglister: <a href="https://dev.eclipse.org/mailman/listinfo/collections-dev">collections-dev</a>-mailinglisten</p> |
| 600 |
<p class="regular">Wiki: <a href="https://github.com/eclipse/eclipse-collections/wiki">GitHub wiki</a></p> |
| 601 |
<p class="regular">Forum: <a href="https://www.eclipse.org/forums/index.php?t=thread&frm_id=329">Eclipse Collections Forum</a></p> |
| 602 |
<p class="regular">StackOverflow: tagget med <a href="http://stackoverflow.com/questions/tagged/eclipse-collections">eclipse-collections</a></p> |
| 603 |
</div> |
| 604 |
<!-- /.col --> |
| 605 |
</div> |
| 606 |
<!-- /.row --> |
| 607 |
|
| 608 |
</div> |
| 609 |
<!-- /.container --> |
| 610 |
|
| 611 |
</div> |
| 612 |
<!-- Container Types --> |
| 613 |
|
| 614 |
|
| 615 |
<div class="banner"> |
| 616 |
|
| 617 |
<div class="container-fluid"> |
| 618 |
|
| 619 |
<div class="row"> |
| 620 |
<div class="col-lg-12"> |
| 621 |
<h3>- Flere funksjoner, mindre søppel -</h3> |
| 622 |
</div> |
| 623 |
</div> |
| 624 |
|
| 625 |
</div> |
| 626 |
<!-- /.container --> |
| 627 |
|
| 628 |
</div> |
| 629 |
<!-- /.banner --> |
| 630 |
|
| 631 |
<!-- Footer --> |
| 632 |
<footer> |
| 633 |
<div class="container-fluid"> |
| 634 |
<div class="row"> |
| 635 |
<div class="col-lg-12"> |
| 636 |
<ul class="list-inline"> |
| 637 |
<li> |
| 638 |
<p class="copyright text-muted small">Copyright © 2018 The Eclipse Foundation. All Rights Reserved. </p> |
| 639 |
</li> |
| 640 |
<li class="footer-menu-divider">⋅</li> |
| 641 |
<li> |
| 642 |
<a class="small" href="http://www.eclipse.org">Eclipse Foundation</a> |
| 643 |
</li> |
| 644 |
<li class="footer-menu-divider">⋅</li> |
| 645 |
<li> |
| 646 |
<a class="small" href="http://www.eclipse.org/legal">Legal</a> |
| 647 |
</li> |
| 648 |
<li class="footer-menu-divider">⋅</li> |
| 649 |
<li> |
| 650 |
<a class="small" href="http://www.eclipse.org/legal/privacy.php">Privacy</a> |
| 651 |
</li> |
| 652 |
<li class="footer-menu-divider">⋅</li> |
| 653 |
<li> |
| 654 |
<a class="small" href="http://www.eclipse.org/legal/termsofuse.php">Terms of Use</a> |
| 655 |
</li> |
| 656 |
<li class="footer-menu-divider">⋅</li> |
| 657 |
<li> |
| 658 |
<a class="small" href="http://www.eclipse.org/legal/copyright.php">Copyright Agent</a> |
| 659 |
</li> |
| 660 |
</ul> |
| 661 |
</div> |
| 662 |
</div> |
| 663 |
</div> |
| 664 |
</footer> |
| 665 |
|
| 666 |
<!-- jQuery --> |
| 667 |
<script src="https://code.jquery.com/jquery-2.2.0.min.js"></script> |
| 668 |
|
| 669 |
<!-- Bootstrap Core JavaScript --> |
| 670 |
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha256-KXn5puMvxCw+dAYznun+drMdG1IFl3agK0p/pqT9KAo= sha512-2e8qq0ETcfWRI4HJBzQiA3UoyFk6tbNyG+qSaIBZLyW9Xf3sWZHN/lxe9fTh1U45DpPf07yj94KsUHHWe4Yk1A==" crossorigin="anonymous"></script> |
| 671 |
|
| 672 |
<!-- Google Code Prettify --> |
| 673 |
<script src="https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js?skin=sunburst"></script> |
| 674 |
</body> |
| 675 |
|
| 676 |
</html> |