Lists
Special purpose implementations of java.util.List
that in the right niche use case can be much more efficient than implementations shipped with the JDK.
<dependency>
<groupId>com.github.marschall</groupId>
<artifactId>lists</artifactId>
<version>1.2.0</version>
</dependency>
The implementations have optimized implementations of java.util.Spliterator
. The implementations support serialization but this has not been optimized.
Currently includes classes:
- SingletonList
- Like Collections.singletonList but mutable
- RepeatingList
- one element repeated several times, immutable
- RepeatingList
- a map function applied to an other list, just a view
- RepeatingList
- a Lisp-style list with a head and a tail
All methods are below 325 byte and should therefore HotSpot should be able to inline them if they are hot.
None of the lists or iterators are fail-fast.