Package com.cedarsoftware.util
Class CompactSet.Builder<E>
java.lang.Object
com.cedarsoftware.util.CompactSet.Builder<E>
- Enclosing class:
CompactSet<E>
Builder for creating CompactSet instances with custom configurations.
Internally, the builder configures a CompactMap
(with <E, Object>).
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Creates a new CompactSet with the configured options.caseSensitive
(boolean caseSensitive) Sets whether String elements should be compared case-sensitively.compactSize
(int size) Sets the maximum size for compact array storage.Configures the set to maintain elements in insertion order.noOrder()
Configures the set to maintain elements in no specific order, like a HashSet.Configures the set to maintain elements in reverse sorted order.Configures the set to maintain elements in natural sorted order.
-
Method Details
-
caseSensitive
Sets whether String elements should be compared case-sensitively.- Parameters:
caseSensitive
- if false, do case-insensitive compares
-
compactSize
Sets the maximum size for compact array storage. -
sortedOrder
Configures the set to maintain elements in natural sorted order.Requires elements to be
Comparable
-
reverseOrder
Configures the set to maintain elements in reverse sorted order.Requires elements to be
Comparable
-
insertionOrder
Configures the set to maintain elements in insertion order. -
noOrder
Configures the set to maintain elements in no specific order, like a HashSet. -
build
Creates a new CompactSet with the configured options.
-