Skip to content

Commit 3722641

Browse files
authored
[JAVA-41973] Moving some article links on Github - core-java-collections (#18030)
1 parent 966331b commit 3722641

File tree

22 files changed

+77
-66
lines changed

22 files changed

+77
-66
lines changed

core-java-modules/core-java-collections-4/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@
1212
- [Java Generics PECS – Producer Extends Consumer Super](https://www.baeldung.com/java-generics-pecs)
1313
- [Reversing a Stack in Java](https://www.baeldung.com/java-reversing-a-stack)
1414
- [Guide to the Java Queue Interface](https://www.baeldung.com/java-queue)
15-
- More articles: [[<-- prev]](/core-java-modules/core-java-collections-3)
15+
- More articles: [[<-- prev]](/core-java-modules/core-java-collections-3)[[next -->]](/core-java-modules/core-java-collections-5)

core-java-modules/core-java-collections-5/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@
1212
- [Comparison of for Loops and Iterators](https://www.baeldung.com/java-for-loops-vs-iterators)
1313
- [PriorityQueue iterator() Method in Java](https://www.baeldung.com/java-priorityqueue-iterator)
1414
- [Immutable vs Unmodifiable Collection in Java](https://www.baeldung.com/java-collection-immutable-unmodifiable-differences)
15-
- More articles: [[<-- prev]](/core-java-modules/core-java-collections-4)
15+
- More articles: [[<-- prev]](/core-java-modules/core-java-collections-4)[[next -->]](/core-java-modules/core-java-collections-6)

core-java-modules/core-java-collections-6/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@
1111
- [Introduction to the Java ArrayDeque](https://www.baeldung.com/java-array-deque)
1212
- [An Introduction to Java.util.Hashtable Class](https://www.baeldung.com/java-hash-table)
1313
- [Fail-Safe Iterator vs Fail-Fast Iterator](https://www.baeldung.com/java-fail-safe-vs-fail-fast-iterator)
14-
- More articles: [[<-- prev]](/core-java-modules/core-java-collections-5)
14+
- More articles: [[<-- prev]](/core-java-modules/core-java-collections-5)[[next -->]](/core-java-modules/core-java-collections-7)

core-java-modules/core-java-collections-7/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,8 @@
33
## Core Java Collections Cookbooks and Examples
44

55
### Relevant Articles:
6+
- [Defining a Char Stack in Java](https://www.baeldung.com/java-char-stack)
7+
- [Thread Safe LIFO Data Structure Implementations](https://www.baeldung.com/java-lifo-thread-safe)
8+
- [Time Complexity of Java Collections](https://www.baeldung.com/java-collections-complexity)
9+
- [Convert an Array of Primitives to a List](https://www.baeldung.com/java-primitive-array-to-list)
610
- More articles: [[<-- prev]](/core-java-modules/core-java-collections-6)

core-java-modules/core-java-collections-7/pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@
1414
</parent>
1515

1616
<dependencies>
17+
<dependency>
18+
<groupId>org.apache.commons</groupId>
19+
<artifactId>commons-lang3</artifactId>
20+
<version>${commons-lang3.version}</version>
21+
</dependency>
1722
<dependency>
1823
<groupId>org.junit.jupiter</groupId>
1924
<artifactId>junit-jupiter</artifactId>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.baeldung.collections.convertarrayprimitives;
1+
package com.baeldung.convertarrayprimitives;
22

33
import java.util.ArrayList;
44
import java.util.Arrays;
Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,21 @@
11
package com.baeldung.performance;
22

3-
import org.openjdk.jmh.annotations.*;
3+
import java.util.concurrent.CopyOnWriteArrayList;
4+
import java.util.concurrent.TimeUnit;
5+
6+
import org.openjdk.jmh.annotations.Benchmark;
7+
import org.openjdk.jmh.annotations.BenchmarkMode;
8+
import org.openjdk.jmh.annotations.Level;
9+
import org.openjdk.jmh.annotations.Mode;
10+
import org.openjdk.jmh.annotations.OutputTimeUnit;
11+
import org.openjdk.jmh.annotations.Scope;
12+
import org.openjdk.jmh.annotations.Setup;
13+
import org.openjdk.jmh.annotations.State;
14+
import org.openjdk.jmh.annotations.Warmup;
415
import org.openjdk.jmh.runner.Runner;
516
import org.openjdk.jmh.runner.options.Options;
617
import org.openjdk.jmh.runner.options.OptionsBuilder;
718

8-
import java.util.concurrent.CopyOnWriteArrayList;
9-
import java.util.concurrent.TimeUnit;
10-
1119
@BenchmarkMode(Mode.AverageTime)
1220
@OutputTimeUnit(TimeUnit.MICROSECONDS)
1321
@Warmup(iterations = 10)
@@ -37,32 +45,32 @@ public void setUp() {
3745
}
3846

3947
@Benchmark
40-
public void testAdd(CopyOnWriteBenchmark.MyState state) {
48+
public void testAdd(MyState state) {
4149
state.employeeList.add(new Employee(state.iterations + 1, "John"));
4250
}
4351

4452
@Benchmark
45-
public void testAddAt(CopyOnWriteBenchmark.MyState state) {
53+
public void testAddAt(MyState state) {
4654
state.employeeList.add((int) (state.iterations), new Employee(state.iterations, "John"));
4755
}
4856

4957
@Benchmark
50-
public boolean testContains(CopyOnWriteBenchmark.MyState state) {
58+
public boolean testContains(MyState state) {
5159
return state.employeeList.contains(state.employee);
5260
}
5361

5462
@Benchmark
55-
public int testIndexOf(CopyOnWriteBenchmark.MyState state) {
63+
public int testIndexOf(MyState state) {
5664
return state.employeeList.indexOf(state.employee);
5765
}
5866

5967
@Benchmark
60-
public Employee testGet(CopyOnWriteBenchmark.MyState state) {
68+
public Employee testGet(MyState state) {
6169
return state.employeeList.get(state.employeeIndex);
6270
}
6371

6472
@Benchmark
65-
public boolean testRemove(CopyOnWriteBenchmark.MyState state) {
73+
public boolean testRemove(MyState state) {
6674
return state.employeeList.remove(state.employee);
6775
}
6876

0 commit comments

Comments
 (0)