*/
/**
- * Resizable array implementation of the {@link Dequeu} interface.
+ * Resizable array implementation of the {@link Deque} interface.
*
* The storage array grows automatically when needed.
*
* @param aptr Atomic pointer.
* @param mask Mask of bits.
* @param mask_out Result of mask.
- * @returns Hazard pointer containing the element.
+ * @return Hazard pointer containing the element.
*/
public static HazardPointer<G>? get_hazard_pointer<G> (G **aptr, size_t mask = 0, out size_t mask_out = null) {
unowned Node node = acquire ();
* @param aptr Atomic pointer.
* @param mask Mask of flags.
* @param mask_out Result of mask.
- * @returns A copy of object from atomic pointer.
+ * @return A copy of object from atomic pointer.
*/
public static G? get_pointer<G> (G **aptr, size_t mask = 0, out size_t mask_out = null) {
unowned Node node = acquire ();
* @param mask Mask of flags.
* @param new_mask New mask.
* @param old_mask Previous mask mask.
- * @returns Hazard pointer containing old value.
+ * @return Hazard pointer containing old value.
*/
public static HazardPointer<G>? exchange_hazard_pointer<G> (G **aptr, owned G? new_ptr, size_t mask = 0, size_t new_mask = 0, out size_t old_mask = null) {
unowned Node? new_node = null;
* @param mask Mask of flags.
* @param new_mask New mask.
* @param old_mask Previous mask mask.
- * @returns Value that was previously stored.
+ * @return Value that was previously stored.
*/
public static G? exchange_pointer<G> (G **aptr, owned G? new_ptr, size_t mask = 0, size_t new_mask = 0, out size_t old_mask = null) {
HazardPointer<G>? ptr = exchange_hazard_pointer<G> (aptr, new_ptr, mask, new_mask, out old_mask);
*
* @param aptr Atomic pointer.
* @param old_ptr Old pointer.
- * @param new_ptr New value.
+ * @param _new_ptr New value.
* @param old_mask Old mask.
* @param new_mask New mask.
- * @returns Value that was previously stored.
+ * @return Value that was previously stored.
*/
public static bool compare_and_exchange_pointer<G> (G **aptr, G? old_ptr, owned G? _new_ptr, size_t mask = 0, size_t old_mask = 0, size_t new_mask = 0) {
G *new_ptr = (owned)_new_ptr;
/**
* Gets the pointer hold by hazard pointer.
*
- * @params other_thread Have to be set to ``true'' if accessed from thread that did not create this thread.
- * @returns The value hold by pointer.
+ * @param other_thread Have to be set to ``true`` if accessed from thread that did not create this thread.
+ * @return The value hold by pointer.
*/
public inline new unowned G get (bool other_thread = false) {
return _node[other_thread];
/**
* Free the pointer.
*
- * @params DestroyNotify method freeing object
+ * @param notify method freeing object
*/
public void release (DestroyNotify notify) {
unowned G item = _node[false];
* Sets default policy (i.e. default policy for user-created contexts).
* The policy must be concrete and should not be blocking.
*
- * @params policy New default policy.
+ * @param policy New default policy.
*/
public static void set_default_policy (Policy policy) requires (policy.is_concrete ()) {
if (policy.is_blocking ())
* Sets thread exit policy (i.e. default policy for the top-most Context).
* The policy must be concrete and should not be unsafe.
*
- * @params policy New thread policy.
+ * @param policy New thread policy.
*/
public static void set_thread_exit_policy (Policy policy) requires (policy.is_concrete ()) {
if (!policy.is_safe ())
*
* The method can be only set before any objects is released and is not thread-safe.
*
- * @params policy New release policy.
+ * @param policy New release policy.
*/
public static bool set_release_policy (ReleasePolicy policy) {
int old_policy = AtomicInt.get (ref release_policy);
/**
* Checks if the policy is concrete or if it depends on global variables.
*
- * @returns ``true'' if this policy does not depend on global variables
+ * @return ``true`` if this policy does not depend on global variables
*/
public bool is_concrete () {
switch (this) {
* Checks if policy blocks or is lock-free.
* Please note that it works on a concrete policy only.
*
- * @returns ``true'' if the policy may block the thread.
+ * @return ``true`` if the policy may block the thread.
*/
public bool is_blocking () requires (this.is_concrete ()) {
switch (this) {
* Checks if policy guarantees freeing all elements.
* Please note that it works on a concrete policy only.
*
- * @returns ``true'' if the policy guarantees freeing all elements.
+ * @return ``true`` if the policy guarantees freeing all elements.
*/
public bool is_safe () requires (this.is_concrete ()) {
switch (this) {
/**
* Finds concrete policy which corresponds to given policy.
*
- * @returns Policy that corresponds to given policy at given time in given thread.
+ * @return Policy that corresponds to given policy at given time in given thread.
*/
public Policy to_concrete () ensures (result.is_concrete ()) {
switch (this) {
/**
* Runs the policy.
* @param to_free List containing elements to free.
- * @returns Non-empty list of not freed elements or ``null'' if all elements have been disposed.
+ * @return Non-empty list of not freed elements or ``null`` if all elements have been disposed.
*/
internal ArrayList<FreeNode *>? perform (owned ArrayList<FreeNode *> to_free) {
switch (this.to_concrete ()) {
* {{{
* Context ctx = new Context ();
* lock_free_collection.operation1 ();
- * // Normally on exit the thread exit operation would be executed but here the default operation of child context is executed.
+ * // Normally on exit the thread exit operation would be executed but here the default operation of
+ * // child context is executed.
* lock_free_collection.operation2 ();
* }}}
*
/**
* Tries to free from list.
*
- * @return ``true'' if list is empty.
+ * @return ``true`` if list is empty.
*/
internal static bool try_free (ArrayList<FreeNode *> to_free) {
Collection<void *> used = new HashSet<void *>();
public abstract bool read_only { get; }
/**
- * Default implementation of {@link Iterator.stream}.
+ * Default implementation of {@link Traversable.stream}.
*
* @param self Current Iterator
* @param f Stream function
- * @returns Transformed stream
- * @see stream
+ * @return Transformed stream
+ * @see Traversable.stream
*/
public static Iterator<A> stream_impl<G, A> (Iterator<G> self, owned StreamFunc<G, A> f) {
Traversable.Stream str;
/**
* Create iterator from unfolding function. The lazy value is
- * force-evaluated before progressing to next element.
- *
- * @param f Unfolding function
- * @param current If iterator is to be valid it contains the current value of it
+ * force-evaluated before progressing to next element.
+ *
+ * @param f Unfolding function
+ * @param current If iterator is to be valid it contains the current value of it
*/
public static Iterator<A> unfold<A> (owned UnfoldFunc<A> f, owned Lazy<G>? current = null) {
return new UnfoldIterator<A> ((owned) f, (owned) current);
public abstract bool is_empty { get; }
/**
- * Specifies whether this collection can change - i.e. wheather {@link add},
+ * Specifies whether this collection can change - i.e. wheather {@link set},
* {@link remove} etc. are legal operations.
*/
public abstract bool read_only { get; }
public abstract int size { get; }
/**
- * Specifies whether this collection can change - i.e. wheather {@link add},
+ * Specifies whether this collection can change - i.e. wheather {@link set},
* {@link remove} etc. are legal operations.
*/
public abstract bool read_only { get; }
* Returns the sub-set of this sorted set containing elements strictly
* lower than the specified element.
*
- * @param from the lower inclusive bound for the sub-set
+ * @param before the lower inclusive bound for the sub-set
*
* @return the corresponding sub-set of this sorted set
*/
* Returns the sub-set of this sorted set containing elements equal or
* higher than the specified element.
*
- * @param to the higher exclusive bound for the sub-set
+ * @param after the higher exclusive bound for the sub-set
*
* @return the corresponding sub-set of this sorted set
*/
*
* ''{@link Iterator} implementation:'' Please note that most of the functions
* affect the state of the iterator by moving it forward.
- * Even if the iterator is {@link BidirIterator bidirectional} it ''must not''
+ * Even if the iterator is {@link BidirIterator} it ''must not''
* rewind the state.
*
- * ''{@link Iterable} implementation:'' {@link Iterator.valid validity}
- * of returned iterator is the same as for {@link Iterator.valid invalid}
+ * ''{@link Iterable} implementation:'' validy ({@link Iterator.valid})
+ * of returned iterator is the same as for invalid
* iterator. In other words the following code is semantically equivalent:
*
- * {{
+ * {{{
* var x = iterable.function (args);
* var x = iterable.iterator ().function(args);
- * }}
+ * }}}
*
* @since 0.7.0
*/
* 1. state. It is usually the last returned value from function but
* it may be {@link Stream.END} when {@link Stream.CONTINUE} was
* returned and there was no more elements.
- * 2. input. It is valid only if first argument is
+ * 1. input. It is valid only if first argument is
* {@link Stream.CONTINUE}
- * 3. output. It is valid only if result is Stream.YIELD
+ * 1. output. It is valid only if result is Stream.YIELD
*
* It may return one of 3 results:
*
* 1. {@link Stream.YIELD}. It means that value was yielded and can
* be passed to outgoing iterator.
- * 2. {@link Stream.CONTINUE}. It means that the function needs to be
+ * 1. {@link Stream.CONTINUE}. It means that the function needs to be
* called with next element or with {@link Stream.END} if it is
* end of stream). If the state element was Stream.END during the
* current iteration function ''must not'' return {@link Stream.CONTINUE}
- * 3. Stream.END. It means that the last argument was yielded.
+ * 1. Stream.END. It means that the last argument was yielded.
*
* If the function yields the value immediately then the returning iterator
- * is {@link valid} and points to this value as well as in case when the
- * parent iterator is {@link Iterator.valid valid} and function yields
+ * is {@link Iterator.valid} and points to this value as well as in case when the
+ * parent iterator is {@link Iterator.valid} and function yields
* after consuming 1 input. In other case returned iterator is invalid.
*
* ''{@link Iterator} implementation:'' If iterator is
- * {@link Iterator.valid valid} the current value should be fed
+ * {@link Iterator.valid} the current value should be fed
* immediately to function if during initial call function returns
* {@link Stream.CONTINUE}. The parent iterator cannot be used before
* the functions return {@link Stream.END} afterwards it points on the
*
* ''{@link Iterator} implementation:'' Operation moves the iterator to
* last element in iteration. If iterator is
- * {@link Iterator.valid valid} the current element will be considered
+ * {@link Iterator.valid} the current element will be considered
* as well.
*
*/
* Produces an iterator pointing at elements generated by function passed.
*
* Iterator is lazy evaluated but value is force-evaluated when
- * iterator {@link Iterator.next moves to next element}.
+ * iterator moves to next element. ({@link Iterator.next})
*
* ''Note:'' Default implementation uses {@link stream}.
*
* ''{@link Iterator} implementation:'' If the parent iterator is
- * {@link Iterator.valid valid} so is the returned one. Using the parent
- * iterator is not allowed before the inner iterator {@link Iterator.next
- * next} return false and then it points on its last element.
+ * {@link Iterator.valid} so is the returned one. Using the parent
+ * iterator is not allowed before the inner iterator {@link Iterator.next}
+ * return false and then it points on its last element.
*
* @param f Mapping function
* @return Iterator listing mapped value
* ''Note:'' Default implementation uses {@link stream}.
*
* ''{@link Iterator} implementation:'' Using the parent
- * iterator is not allowed befor the inner iterator {@link Iterator.next
- * next} return false and then it points on its last element.
+ * iterator is not allowed befor the inner iterator {@link Iterator.next}
+ * return false and then it points on its last element.
*
* @param f Folding function
* @param seed original seed value
* ''Note:'' There is implementation {@link filter_impl}.
*
* ''{@link Iterator} implementation:'' Resulting iterator is valid. Using the parent
- * iterator is not allowed before the inner iterator {@link Iterator.next
- * next} return false and then it points on its last element.
+ * iterator is not allowed before the inner iterator {@link Iterator.next}
+ * return false and then it points on its last element.
*
* @param f Folding function
- * @param seed original seed value
* @return Iterator containing values of subsequent values of seed
*/
public abstract Iterator<G> filter (owned Predicate<G> f);
*
* ''{@link Iterator} implementation:'' Resulting iterator is valid when
* parent iterator is valid and the offset is 0. Using the parent
- * iterator is not allowed before the inner iterator {@link Iterator.next
- * next} return false and then it points on its last element.
+ * iterator is not allowed before the inner iterator {@link Iterator.next}
+ * return false and then it points on its last element.
*
* ''{@link Iterable} implementation:'' Resulting iterator is invalid.
*
*
* @param input The current Traversable
* @param pred Predicate
- * @returns Filtered iterator
+ * @return Filtered iterator
* @see filter
* @see stream
*/
}
}
/**
- * @inheritDoc
+ * {@inheritDoc}
*/
public override SortedSet<Map.Entry<K,V>> ascending_entries {
owned get {
}
/**
- * @inheritDoc
+ * {@inheritDoc}
*/
public override Gee.MapIterator<K,V> map_iterator () {
return new MapIterator<K,V> (this);
}
/**
- * @inheritDoc
+ * {@inheritDoc}
*/
public override Gee.BidirMapIterator<K,V> bidir_map_iterator () {
return new MapIterator<K,V> (this);