See: Description
Annotation Type | Description |
---|---|
Mutable |
Specifies that Koloboke Compile should generate a
mutable (general-purpose) implementation of the annotated class or interface.
|
Updatable |
Specifies that Koloboke Compile should generate an
updatable implementation of the annotated class or interface.
|
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()
.