Skip navigation links

Package com.koloboke.compile.mutability

Contains annotations specifying that Koloboke Compile should generate implementations of the annotated types with a particular mutability profile.

See: Description

Package com.koloboke.compile.mutability Description

Contains annotations specifying that Koloboke Compile should generate implementations of the annotated types with a particular mutability profile.

At most one annotation of an annotation type from this package could be applied to a class or a interface.

If none of the annotations from this package is applied to a @KolobokeMap- or @KolobokeSet-annotated type, Koloboke Compile generates an implementation with the least mutability, which supports all the abstract methods in an implemented type. For example, if a @KolobokeSet-annotated class has only four abstract methods: add(e), contains(e), size() and clear(), Koloboke Compile generates an updatable implementation for this class, because all abstract methods are supported by updatable mutability profile. If a @KolobokeMap-annotated class or interface has an abstract remove(key) method, by default Koloboke Compile generates a mutable implementation for this type, because remove(key) method is supported by Mutable and not supported by Updatable mutability profile.

See full list of methods, supported by different mutability profiles, for Set-like and Map-like types.

In the Koloboke Collections API, the client makes the mutability profile choice at the moment of a set or map construction. Factory methods offer methods called newMutableXxx and newUpdatableXxx, e. g. IntSetFactory.newUpdatableSet(), IntSetFactory.newMutableSet().

See Also:
Mutability section in the @KolobokeMap specification, Mutability section in the @KolobokeSet specification
Skip navigation links