Module org.tquadrat.foundation.util
Class LazySetImpl<E>
java.lang.Object
org.tquadrat.foundation.util.internal.LazySetImpl<E>
- Type Parameters:
E- The type of elements in this set.
- All Implemented Interfaces:
Iterable<E>,Collection<E>,Set<E>,LazySet<E>
@ClassVersion(sourceVersion="$Id: LazySetImpl.java 1060 2023-09-24 19:21:40Z tquadrat $")
@API(status=INTERNAL,
since="0.0.5")
public final class LazySetImpl<E>
extends Object
implements LazySet<E>
The implementation for
LazySet.- Author:
- Thomas Thrien (thomas.thrien@tquadrat.org)
- Version:
- $Id: LazySetImpl.java 1060 2023-09-24 19:21:40Z tquadrat $
- Since:
- 0.0.5
- UML Diagram
-
UML Diagram for "org.tquadrat.foundation.util.internal.LazySetImpl"
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe holder for the real set.private final booleanThe flag that indicates whether the provided supplier will put values to the set on initialisation. -
Constructor Summary
ConstructorsConstructorDescriptionLazySetImpl(boolean doPopulate, Supplier<? extends Set<E>> supplier) Creates a newLazySetImplinstance.LazySetImpl(Set<E> value) Creates a newLazySetImplinstance that is initialised with the given value. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanfinal booleanaddAll(Collection<? extends E> c) final voidclear()final booleanfinal booleancontainsAll(Collection<?> c) final booleanfinal voidfinal inthashCode()voidIf thisLazySetinstance has been initialised already, the providedConsumerwill be executed; otherwise nothing happens.final voidinit()Forces the initialisation of thisLazySetinstance.final booleanisEmpty()final booleanChecks whether thisLazySetinstance has been initialised already.iterator()final booleanfinal booleanremoveAll(Collection<?> c) final booleanfinal booleanretainAll(Collection<?> c) final intsize()final Spliterator<E> final Object[]toArray()final <T> T[]toArray(T[] a) final StringtoString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, stream, toArray
-
Field Details
-
m_Holder
The holder for the real set. -
m_SupplierPopulates
The flag that indicates whether the provided supplier will put values to the set on initialisation.
-
-
Constructor Details
-
LazySetImpl
Creates a newLazySetImplinstance.- Parameters:
doPopulate-trueif the provided supplier will put values to the set on initialisation,falseif it will create an empty set.supplier- The supplier that initialises the internal set for this instance when it is first needed.
-
LazySetImpl
Creates a newLazySetImplinstance that is initialised with the given value.- Parameters:
value- The initialisation value.
-
-
Method Details
-
add
-
addAll
-
clear
-
contains
-
containsAll
- Specified by:
containsAllin interfaceCollection<E>- Specified by:
containsAllin interfaceSet<E>
-
equals
-
forEach
-
hashCode
-
ifPresent
If thisLazySetinstance has been initialised already, the providedConsumerwill be executed; otherwise nothing happens. -
init
Forces the initialisation of thisLazySetinstance. -
isEmpty
-
isPresent
Checks whether thisLazySetinstance has been initialised already. -
iterator
-
remove
-
removeAll
-
removeIf
- Specified by:
removeIfin interfaceCollection<E>
-
retainAll
-
size
-
spliterator
- Specified by:
spliteratorin interfaceCollection<E>- Specified by:
spliteratorin interfaceIterable<E>- Specified by:
spliteratorin interfaceSet<E>
-
toArray
-
toArray
-
toString
-
