Class ListBasedScalingOrderedSet<E>

java.lang.Object
org.optaplanner.core.impl.util.ListBasedScalingOrderedSet<E>
Type Parameters:
E -
All Implemented Interfaces:
Iterable<E>, Collection<E>, Set<E>

public final class ListBasedScalingOrderedSet<E> extends Object implements Set<E>
An ordered Set which is implemented as a ArrayList for a small Set.size() and a LinkedHashSet for a big Set.size().

This speeds up add(Object) performance (in some cases by 20%) if most instances have a small size because no Object.hashCode() need to be calculated.