From d84bbf15df6996f9a98561f568d7ad1de567f228 Mon Sep 17 00:00:00 2001
From: Jeongho Nam Static class holding enumeration codes of color of Red-black tree. Color codes imposed to nodes of RB-Tree are following those rules: Code of color black. Code of color red. An abstract container. An abstract error instance. Bi-directional iterator. {@link ErrorInstance} is an abstract class of {@link ErrorCode} and {@link ErrorCondition}
- * holding an error instance's identifier {@link value}, associated with a {@link category}. {@link Iterator Bidirectional iterators} are iterators that can be used to access the sequence of elements
+ * in a range in both directions (towards the end and towards the beginning). The operating system and other low-level applications and libraries generate numerical error codes to
- * represent possible results. These numerical values may carry essential information for a specific platform,
- * but be non-portable from one platform to another. All {@link IArrayIterator random-access iterators} are also valid {@link Iterrator bidirectional iterators}.
+ * Objects of this class associate such numerical codes to {@link ErrorCategory error categories},
- * so that they can be interpreted when needed as more abstract (and portable)
- * {@link ErrorCondition error conditions}. There is not a single type of {@link Iterator bidirectional iterator}: {@link IContainer Each container}
+ * may define its own specific iterator type able to iterate through it and access its elements.
+ *
+ * Assign error instance. Assigns the {@link ErrorCode} object a value of val associated with the {@link ErrorCategory}. Clear error instance. Get iterator to previous element. If current iterator is the first item(equal with {@link IContainer.begin IContainer.begin()}),
+ * returns {@link IContainer.end IContainer.end()}. Clears the value in the {@link ErrorCode} object so that it is set to a value of 0 of the
- * {@link ErrorCategory.systemCategory ErrorCategory.systemCategory()} (indicating no error). Get category. Returns a reference to the {@link ErrorCategory} associated with the {@link ErrorCode} object. Get iterator to next element. If current iterator is the last item, returns {@link IContainer.end IContainer.end()}. Error value. Returns the error value associated with the {@link ErrorCode} object. Get message. Returns the message associated with the error instance. Error messages are defined by the {@link category} the error instance belongs to. This function returns the same as if the following member was called: Default error condition. Returns the default {@link ErrorCondition}object associated with the {@link ErrorCode} object. Whether an iterator is equal with the iterator. This function returns the same as if the following member was called: Compare two iterators and returns whether they are equal or not. Iterator's equal_to() only compare souce container and index number. {@link ErrorCategory.default_error_condition ErrorCategory.default_error_condition()}
- * is a virtual member function, that can operate differently for each category. Although elements in a pair, key and value are equal_to, if the source map or
+ * index number is different, then the {@link equal_to equal_to()} will return false. If you want to
+ * compare the elements of a pair, compare them directly by yourself. Convert to bool. Returns whether the error instance has a numerical {@link value} other than 0. If it is zero (which is generally used to represent no error), the function returns false, otherwise it returns true. Get value of the iterator is pointing. Hask buckets. This class reverses the direction in which a bidirectional or random-access iterator iterates through a range.
+ * A copy of the original iterator (the {@link Iterator base iterator}) is kept internally and used to reflect
+ * the operations performed on the {@link ReverseIterator}: whenever the {@link ReverseIterator} is incremented, its
+ * {@link Iterator base iterator} is decreased, and vice versa. A copy of the {@link Iterator base iterator} with the
+ * current state can be obtained at any time by calling member {@link base}. Notice however that when an iterator is reversed, the reversed version does not point to the same element in
+ * the range, but to the one preceding it. This is so, in order to arrange for the past-the-end element of a
+ * range: An iterator pointing to a past-the-end element in a range, when reversed, is pointing to the last element
+ * (not past it) of the range (this would be the first element of the reversed range). And if an iterator to the
+ * first element in a range is reversed, the reversed iterator points to the element before the first element (this
+ * would be the past-the-end element of the reversed range).
+ *
+ * Reconstruction of hash table. Return base iterator. All the elements in the hash buckets are rearranged according to their hash value into the new set of
- * buckets. This may alter the order of iteration of elements within the container. Return a reference of the base iteraotr. Notice that {@link rehash rehashes} are automatically performed whenever its number of elements is going
- * to greater than its own {@link capacity}. The base iterator is an iterator of the same type as the one used to construct the {@link ReverseIterator},
+ * but pointing to the element next to the one the {@link ReverseIterator} is currently pointing to
+ * (a {@link ReverseIterator} has always an offset of -1 with respect to its base iterator).
*
- * @param size Number of bucket size to rehash.
+ * @return A reference of the base iterator, which iterates in the opposite direction.
*/
- rehash(size: number): void;
- clear(): void;
- size(): number;
- item_size(): number;
- capacity(): number;
- at(index: number): Vector Common interface for hash map. {@link IHashMap}s are associative containers that store elements formed by the combination of
- * a key value and a mapped value. In an {@link IHashMap}, the key value is generally used to uniquely identify the
- * element, while the mapped value is an object with the content associated to this key.
- * Types of key and mapped value may differ. Internally, the elements in the {@link IHashMap} are not sorted in any particular order with
- * respect to either their key or mapped values, but organized into buckets depending on
- * their hash values to allow for fast access to individual elements directly by their key values
- * (with a constant average time complexity on average). Elements with equivalent keys are grouped together in the same bucket and in such a way that
- * an iterator can iterate through all of them. Iterators in the container are doubly linked iterators.
- *
- * Return iterator to beginning. Returns an iterator pointing to the first element in the {@link IHashMap}. Notice that an {@link IHashMap} object makes no guarantees on which specific element is considered its
- * first element. But, in any case, the range that goes from its begin to its end covers all the elements in the
- * container, until invalidated. Return iterator to beginning. Returns an iterator pointing to the first element in one of buckets in the {@link IHashMap}. Notice that an {@link IHashMap} object makes no guarantees on which specific element is considered its
- * first element. But, in any case, the range that goes from its begin to its end covers all the elements in the
- * bucket, until invalidated. Return iterator to end. Returns an iterator pointing to the past-the-end element in the {@link HaspMap} container. The iterator returned by end does not point to any element, but to the position that follows the last
- * element in the {@link HaspMap} container (its past-the-end position). Thus, the value returned shall
- * not be dereferenced - it is generally used to describe the open-end of a range, such as
- * [begin, end). Notice that an {@link IHashMap} object makes no guarantees on which order its elements follow. But, in any
- * case, the range that goes from its begin to its end covers all the elements in the container (or the bucket),
- * until invalidated. Return iterator to end. Returns an iterator pointing to the past-the-end element in the {@link HaspMap} container. The iterator returned by end does not point to any element, but to the position that follows the last
- * element in the {@link HaspMap} container (its past-the-end position). Thus, the value returned shall
- * not be dereferenced - it is generally used to describe the open-end of a range, such as
- * [begin, end). Notice that an {@link IHashMap} object makes no guarantees on which order its elements follow. But, in any
- * case, the range that goes from its begin to its end covers all the elements in the container (or the bucket),
- * until invalidated. Return {@link MapReverseIterator reverse iterator} to reverse beginning. Returns a {@link MapReverseIterator reverse iterator} pointing to the last element in the {@link IHashMap}
- * (i.e., its reverse beginning). {@link rbegin} points to the element preceding the one that would be pointed to by member {@link end}. Notice that an {@link IHashMap} object makes no guarantees on which specific element is considered its
- * first element. But, in any case, the range that goes from its begin to its end covers all the elements in the
- * bucket, until invalidated. Return {@link MapReverseIterator reverse iterator} to reverse beginning. Returns a {@link MapReverseIterator reverse iterator} pointing to the last element in one of buckets in the
- * {@link IHashMap} (i.e., its reverse beginning).
- *
- *
- * @author Migrated by Jeongho Nam null
) are black.
- *
- */
- BLACK = 0,
- /**
- * category().message(value())
category().default_error_condition(value())
Note
+ * true
if the error's numerical value is not zero.
- * false
otherwise.
+ * @return A value of the iterator.
*/
- to_bool(): boolean;
+ value: T;
+ abstract swap(obj: Iterator Container properties
- *
- *
- *
- * @param
{@link rbegin} points to the element preceding the one that would be pointed to by member {@link end}.
- * - *Notice that an {@link IHashMap} object makes no guarantees on which specific element is considered its - * first element. But, in any case, the range that goes from its begin to its end covers all the elements in the - * bucket, until invalidated.
- * - * @param index Bucket number. This shall be lower than {@link bucket_count}. - * - * @return A {@link MapReverseIterator reverse iterator} to the reverse beginning of the sequence - */ - rbegin(index: number): MapReverseIteratorReturn {@link MapReverseIterator reverse iterator} to reverse end.
- * - *Returns a {@link MapReverseIterator reverse iterator} pointing to the theoretical element right before - * the first element in the {@link IHashMap hash map container} (which is considered its reverse end).
- * - *The range between {@link IHashMap}.{@link rbegin} and {@link IHashMap}.{@link rend} contains all the - * elements of the container (in reverse order).
- * - *Notice that an {@link IHashMap} object makes no guarantees on which order its elements follow. But, in any - * case, the range that goes from its begin to its end covers all the elements in the container (or the bucket), - * until invalidated.
- * - * @return A {@link MapReverseIterator reverse iterator} to the reverse end of the sequence. - */ - rend(): MapReverseIteratorReturn {@link MapReverseIterator reverse iterator} to reverse end.
- * - *Returns a {@link MapReverseIterator reverse iterator} pointing to the theoretical element right before - * the first element in one of buckets in the {@link IHashMap hash map container} (which is considered its - * reverse end).
- * - *The range between {@link IHashMap}.{@link rbegin} and {@link IHashMap}.{@link rend} contains all the - * elements of the container (in reverse order).
- * - *Notice that an {@link IHashMap} object makes no guarantees on which order its elements follow. But, in any - * case, the range that goes from its begin to its end covers all the elements in the container (or the bucket), - * until invalidated.
- * - * @param index Bucket number. This shall be lower than {@link bucket_count}. - * - * @return A {@link MapReverseIterator reverse iterator} to the reverse end of the sequence. + * @hidden */ - rend(index: number): MapReverseIteratorReturn number of buckets.
- * - *Returns the number of buckets in the {@link IHashMap} container.
- * - *A bucket is a slot in the container's internal hash table to which elements are assigned based on the - * hash value of their key.
- * - *The number of buckets influences directly the {@link load_factor load factor} of the container's hash - * table (and thus the probability of collision). The container automatically increases the number of buckets to - * keep the load factor below a specific threshold (its {@link max_load_factor}), causing a {@link rehash} each - * time the number of buckets needs to be increased.
+ *Get value of the iterator is pointing.
* - * @return The current amount of buckets. + * @return A value of the reverse iterator. */ - bucket_count(): number; + value: T; /** - *Return bucket size.
- * - *Returns the number of elements in bucket n.
- * - *A bucket is a slot in the container's internal hash table to which elements are assigned based on the hash - * value of their key.
- * - *The number of elements in a bucket influences the time it takes to access a particular element in the - * bucket. The container automatically increases the number of buckets to keep the {@link load_cator load factor} - * (which is the average bucket size) below its {@link max_load_factor}.
- * - * @param n Bucket number. This shall be lower than {@link bucket_count}. - * - * @return The number of elements in bucket n. + * @inheritdoc */ - bucket_size(n: number): number; + prev(): This; /** - *Get maximum load factor.
- * - *Returns the current maximum load factor for the {@link HashMultiMap} container.
- * - *The load factor is the ratio between the number of elements in the container (its {@link size}) and the - * number of buckets ({@link bucket_count}).
- * - *By default, {@link HashMultiMap} containers have a {@link max_load_factor} of 1.0.
- * - *The load factor influences the probability of collision in the hash table (i.e., the probability of two - * elements being located in the same bucket). The container uses the value of max_load_factor as the threshold - * that forces an increase in the number of buckets (and thus causing a {@link rehash}).
- * - *Note though, that implementations may impose an upper limit on the number of buckets (see - * {@link max_bucket_count}), which may force the container to ignore the {@link max_load_factor}.
- * - * @return The current load factor. + * @inheritdoc */ - max_load_factor(): number; + next(): This; /** - *Set maximum load factor.
- * - *Sets z as the cnew maximum load factor for the {@link HashMultiMap} container.
- * - *The load factor is the ratio between the number of elements in the container (its {@link size}) and the - * number of buckets ({@link bucket_count}).
- * - *By default, {@link HashMultiMap} containers have a {@link max_load_factor} of 1.0.
- * - *The load factor influences the probability of collision in the hash table (i.e., the probability of two - * elements being located in the same bucket). The container uses the value of max_load_factor as the threshold - * that forces an increase in the number of buckets (and thus causing a {@link rehash}).
- * - *Note though, that implementations may impose an upper limit on the number of buckets (see - * {@link max_bucket_count}), which may force the container to ignore the {@link max_load_factor}.
- * - * @param z The new maximum load factor. + * @inheritdoc */ - max_load_factor(z: number): void; + advance(n: number): This; /** - *Locate element's bucket.
- * - *Returns the bucket number where the element with key is located.
- * - *A bucket is a slot in the container's internal hash table to which elements are assigned based on the - * hash value of their key. Buckets are numbered from 0 to ({@link bucket_count} - 1).
- * - *Individual elements in a bucket can be accessed by means of the range iterators returned by - * {@link begin} and {@link end}.
- * - * @param key Key whose bucket is to be located. + * @inheritdoc */ - bucket(key: Key): number; + equal_to(obj: This): boolean; /** - *Request a capacity change.
- * - *Sets the number of buckets in the container ({@link bucket_count}) to the most appropriate to contain at - * least n elements.
- * - *If n is greater than the current {@link bucket_count} multiplied by the {@link max_load_factor}, - * the container's {@link bucket_count} is increased and a {@link rehash} is forced.
- * - *If n is lower than that, the function may have no effect.
- * - * @param n The number of elements requested as minimum capacity. + * @inheritdoc */ - reserve(n: number): void; - /** - *Set number of buckets.
- * - *Sets the number of buckets in the container to n or more.
- * - *If n is greater than the current number of buckets in the container ({@link bucket_count}), a - * {@link HashBuckets.rehash rehash} is forced. The new {@link bucket_count bucket count} can either be equal or - * greater than n.
- * - *If n is lower than the current number of buckets in the container ({@link bucket_count}), the - * function may have no effect on the {@link bucket_count bucket count} and may not force a - * {@link HashBuckets.rehash rehash}.
- * - *A {@link HashBuckets.rehash rehash} is the reconstruction of the hash table: All the elements in the - * container are rearranged according to their hash value into the new set of buckets. This may alter the order - * of iteration of elements within the container.
- * - *{@link HashBuckets.rehash Rehashes} are automatically performed by the container whenever its - * {@link load_factor load factor} is going to surpass its {@link max_load_factor} in an operation.
- * - *Notice that this function expects the number of buckets as argument. A similar function exists, - * {@link reserve}, that expects the number of elements in the container as argument.
- * - * @param n The minimum number of buckets for the container hash table. - */ - rehash(n: number): void; + swap(obj: This): void; } -} -declare namespace std.base { /** - *Hash buckets storing {@link MapIterator MapIterators}.
+ *Return distance between {@link Iterator iterators}.
* - *- * - *
+ *Calculates the number of elements between first and last.
* - * @author Jeongho NamIf it is a {@link IArrayIterator random-access iterator}, the function uses operator- to calculate this. + * Otherwise, the function uses the increase operator {@link Iterator.next next()} repeatedly.
+ * + * @param first Iterator pointing to the initial element. + * @param last Iterator pointing to the final element. This must be reachable from first. + * + * @return The number of elements between first and last. */ - class MapHashBucketsA common interface for hash set.
+ *Advance iterator.
* - *{@link IHashSet}s are containers that store unique elements in no particular order, and which - * allow for fast retrieval of individual elements based on their value.
+ *Advances the iterator it by n elements positions.
* - *In an {@link IHashSet}, the value of an element is at the same time its key, that - * identifies it uniquely. Keys are immutable, therefore, the elements in an {@link IHashSet} cannot be - * modified once in the container - they can be inserted and removed, though.
+ * @param it Iterator to be advanced. + * @param n Number of element positions to advance. * - *Internally, the elements in the {@link IHashSet} are not sorted in any particular order, but - * organized into buckets depending on their hash values to allow for fast access to individual elements - * directly by their values (with a constant average time complexity on average).
+ * @return An iterator to the element n positions before it. + */ + function advanceGet iterator to previous element.
* - *{@link IHashSet} containers are faster than {@link TreeSet} containers to access individual - * elements by their key, although they are generally less efficient for range iteration through a - * subset of their elements.
+ *Returns an iterator pointing to the element that it would be pointing to if advanced -n positions.
* - *- * - *
+ * @param it Iterator to base position. + * @param n Number of element positions offset (1 by default). * - *Get iterator to next element.
* - *Returns an iterator pointing to the element that it would be pointing to if advanced n positions.
* - *Iterator to beginning.
* - * @reference http://www.cplusplus.com/reference/unordered_set/unordered_set - * @author Jeongho NamReturns an iterator pointing to the first element in the sequence.
+ * + *If the sequence is empty, the returned value shall not be dereferenced.
+ * + * @param container A container object of a class type for which member {@link IContainer.begin begin} is defined. + * + * @return The same as returned by {@link IContainer.begin container.begin()}. */ - interface IHashSetReturn iterator to beginning.
- * - *Returns an iterator pointing to the first element in the {@link IHashSet}.
- * - *Notice that an {@link IHashSet} object makes no guarantees on which specific element is considered its - * first element. But, in any case, the range that goes from its begin to its end covers all the elements in the - * container, until invalidated.
- * - * @return An iterator to the first element in the container. - */ - begin(): SetIteratorReturn iterator to beginning.
- * - *Returns an iterator pointing to the first element in one of buckets in the {@link IHashSet}.
- * - *Notice that an {@link IHashSet} object makes no guarantees on which specific element is considered its - * first element. But, in any case, the range that goes from its begin to its end covers all the elements in the - * bucket, until invalidated.
- * - * @param index Bucket number. This shall be lower than {@link bucket_count}. - * - * @return An iterator to the first element in the bucket. - */ - begin(index: number): SetIteratorReturn iterator to end.
- * - *Returns an iterator pointing to the past-the-end element in the {@link HaspMap} container.
- * - *The iterator returned by end does not point to any element, but to the position that follows the last - * element in the {@link HaspMap} container (its past-the-end position). Thus, the value returned shall - * not be dereferenced - it is generally used to describe the open-end of a range, such as - * [begin, end).
- * - *Notice that an {@link IHashSet} object makes no guarantees on which order its elements follow. But, in any - * case, the range that goes from its begin to its end covers all the elements in the container (or the bucket), - * until invalidated.
- * - * @return An iterator to the element past the end of the container. - */ - end(): SetIteratorReturn iterator to end.
- * - *Returns an iterator pointing to the past-the-end element in the {@link HaspMap} container.
- * - *The iterator returned by end does not point to any element, but to the position that follows the last - * element in the {@link HaspMap} container (its past-the-end position). Thus, the value returned shall - * not be dereferenced - it is generally used to describe the open-end of a range, such as - * [begin, end).
- * - *Notice that an {@link IHashSet} object makes no guarantees on which order its elements follow. But, in any - * case, the range that goes from its begin to its end covers all the elements in the container (or the bucket), - * until invalidated.
- * - * @param index Bucket number. This shall be lower than {@link bucket_count}. - * - * @return An iterator to the element past the end of the bucket. - */ - end(index: number): SetIteratorReturn number of buckets.
- * - *Returns the number of buckets in the {@link IHashSet} container.
- * - *A bucket is a slot in the container's internal hash table to which elements are assigned based on the - * hash value of their key.
- * - *The number of buckets influences directly the {@link load_factor load factor} of the container's hash - * table (and thus the probability of collision). The container automatically increases the number of buckets to - * keep the load factor below a specific threshold (its {@link max_load_factor}), causing a {@link rehash} each - * time the number of buckets needs to be increased.
- * - * @return The current amount of buckets. - */ - bucket_count(): number; - /** - *Return bucket size.
- * - *Returns the number of elements in bucket n.
- * - *A bucket is a slot in the container's internal hash table to which elements are assigned based on the hash - * value of their key.
- * - *The number of elements in a bucket influences the time it takes to access a particular element in the - * bucket. The container automatically increases the number of buckets to keep the {@link load_cator load factor} - * (which is the average bucket size) below its {@link max_load_factor}.
- * - * @param n Bucket number. This shall be lower than {@link bucket_count}. - * - * @return The number of elements in bucket n. - */ - bucket_size(n: number): number; - /** - *Get maximum load factor.
- * - *Returns the current maximum load factor for the {@link HashMultiMap} container.
- * - *The load factor is the ratio between the number of elements in the container (its {@link size}) and the - * number of buckets ({@link bucket_count}).
- * - *By default, {@link HashMultiMap} containers have a {@link max_load_factor} of 1.0.
- * - *The load factor influences the probability of collision in the hash table (i.e., the probability of two - * elements being located in the same bucket). The container uses the value of max_load_factor as the threshold - * that forces an increase in the number of buckets (and thus causing a {@link rehash}).
- * - *Note though, that implementations may impose an upper limit on the number of buckets (see - * {@link max_bucket_count}), which may force the container to ignore the {@link max_load_factor}.
- * - * @return The current load factor. - */ - max_load_factor(): number; - /** - *Set maximum load factor.
- * - *Sets z as the cnew maximum load factor for the {@link HashMultiMap} container.
- * - *The load factor is the ratio between the number of elements in the container (its {@link size}) and the - * number of buckets ({@link bucket_count}).
- * - *By default, {@link HashMultiMap} containers have a {@link max_load_factor} of 1.0.
- * - *The load factor influences the probability of collision in the hash table (i.e., the probability of two - * elements being located in the same bucket). The container uses the value of max_load_factor as the threshold - * that forces an increase in the number of buckets (and thus causing a {@link rehash}).
- * - *Note though, that implementations may impose an upper limit on the number of buckets (see - * {@link max_bucket_count}), which may force the container to ignore the {@link max_load_factor}.
- * - * @param z The new maximum load factor. - */ - max_load_factor(z: number): void; - /** - *Locate element's bucket.
- * - *Returns the bucket number where the element with key is located.
- * - *A bucket is a slot in the container's internal hash table to which elements are assigned based on the - * hash value of their key. Buckets are numbered from 0 to ({@link bucket_count} - 1).
- * - *Individual elements in a bucket can be accessed by means of the range iterators returned by - * {@link begin} and {@link end}.
- * - * @param key Key whose bucket is to be located. - */ - bucket(key: T): number; - /** - *Request a capacity change.
- * - *Sets the number of buckets in the container ({@link bucket_count}) to the most appropriate to contain at - * least n elements.
- * - *If n is greater than the current {@link bucket_count} multiplied by the {@link max_load_factor}, - * the container's {@link bucket_count} is increased and a {@link rehash} is forced.
- * - *If n is lower than that, the function may have no effect.
- * - * @param n The number of elements requested as minimum capacity. - */ - reserve(n: number): void; - /** - *Set number of buckets.
- * - *Sets the number of buckets in the container to n or more.
- * - *If n is greater than the current number of buckets in the container ({@link bucket_count}), a - * {@link HashBuckets.rehash rehash} is forced. The new {@link bucket_count bucket count} can either be equal or - * greater than n.
- * - *If n is lower than the current number of buckets in the container ({@link bucket_count}), the - * function may have no effect on the {@link bucket_count bucket count} and may not force a - * {@link HashBuckets.rehash rehash}.
- * - *A {@link HashBuckets.rehash rehash} is the reconstruction of the hash table: All the elements in the - * container are rearranged according to their hash value into the new set of buckets. This may alter the order - * of iteration of elements within the container.
- * - *{@link HashBuckets.rehash Rehashes} are automatically performed by the container whenever its - * {@link load_factor load factor} is going to surpass its {@link max_load_factor} in an operation.
- * - *Notice that this function expects the number of buckets as argument. A similar function exists, - * {@link reserve}, that expects the number of elements in the container as argument.
- * - * @param n The minimum number of buckets for the container hash table. - */ - rehash(n: number): void; - } -} -declare namespace std.base { + function beginHash buckets storing {@link SetIterator SetIterators}.
+ *Iterator to beginning.
* - *- * - *
+ *Returns an iterator pointing to the first element in the sequence.
* - * @author Jeongho NamIf the sequence is empty, the returned value shall not be dereferenced.
+ * + * @param container A container object of a class type for which member {@link IContainer.begin begin} is defined. + * + * @return The same as returned by {@link IContainer.begin container.begin()}. */ - class SetHashBucketsIterator to beginning.
+ * + *Returns an iterator pointing to the first element in the sequence.
+ * + *If the sequence is empty, the returned value shall not be dereferenced.
+ * + * @param container A container object of a class type for which member {@link IContainer.begin begin} is defined. + * + * @return The same as returned by {@link IContainer.begin container.begin()}. + */ + function beginIterator to beginning.
+ * + *Returns an iterator pointing to the first element in the sequence.
+ * + *If the sequence is empty, the returned value shall not be dereferenced.
+ * + * @param container A container object of a class type for which member {@link IContainer.begin begin} is defined. + * + * @return The same as returned by {@link IContainer.begin container.begin()}. + */ + function beginIterator to beginning.
+ * + *Returns an iterator pointing to the first element in the sequence.
+ * + *If the sequence is empty, the returned value shall not be dereferenced.
+ * + * @param container A container object of a class type for which member {@link IContainer.begin begin} is defined. + * + * @return The same as returned by {@link IContainer.begin container.begin()}. + */ + function beginIterator to end.
+ * + *Returns an iterator pointing to the past-the-end element in the sequence.
+ * + *If the sequence is {@link IContainer.empty empty}, the returned value compares equal to the one returned by {@link begin} with the same argument.
+ * + * @param container A container of a class type for which member {@link IContainer.end end} is defined. + * + * @return The same as returned by {@link IContainer.end container.end()}. + */ + function endIterator to end.
+ * + *Returns an iterator pointing to the past-the-end element in the sequence.
+ * + *If the sequence is {@link IContainer.empty empty}, the returned value compares equal to the one returned by {@link begin} with the same argument.
+ * + * @param container A container of a class type for which member {@link IContainer.end end} is defined. + * + * @return The same as returned by {@link IContainer.end container.end()}. + */ + function endIterator to end.
+ * + *Returns an iterator pointing to the past-the-end element in the sequence.
+ * + *If the sequence is {@link IContainer.empty empty}, the returned value compares equal to the one returned by {@link begin} with the same argument.
+ * + * @param container A container of a class type for which member {@link IContainer.end end} is defined. + * + * @return The same as returned by {@link IContainer.end container.end()}. + */ + function endIterator to end.
+ * + *Returns an iterator pointing to the past-the-end element in the sequence.
+ * + *If the sequence is {@link IContainer.empty empty}, the returned value compares equal to the one returned by {@link begin} with the same argument.
+ * + * @param container A container of a class type for which member {@link IContainer.end end} is defined. + * + * @return The same as returned by {@link IContainer.end container.end()}. + */ + function endIterator to end.
+ * + *Returns an iterator pointing to the past-the-end element in the sequence.
+ * + *If the sequence is {@link IContainer.empty empty}, the returned value compares equal to the one returned by {@link begin} with the same argument.
+ * + * @param container A container of a class type for which member {@link IContainer.end end} is defined. + * + * @return The same as returned by {@link IContainer.end container.end()}. + */ + function endArray
+ *Double ended queue.
* - *{@link IArray} is an interface for sequence containers representing arrays that can change in - * {@link size}. However, compared to arrays, {@link IArray} objectss consume more memory in exchange for - * the ability to manage storage and grow dynamically in an efficient way.
+ *{@link Deque} (usually pronounced like "deck") is an irregular acronym of + * double-ended queue. Double-ended queues are sequence containers with dynamic sizes that can be + * expanded or contracted on both ends (either its front or its back).
* - *Both {@link Vector Vectors} and {@link Deque Deques} who implemented {@link IArray} provide a very - * similar interface and can be used for similar purposes, but internally both work in quite different ways: - * While {@link Vector Vectors} use a single array that needs to be occasionally reallocated for growth, the - * elements of a {@link Deque} can be scattered in different chunks of storage, with the container keeping the - * necessary information internally to provide direct access to any of its elements in constant time and with a - * uniform sequential interface (through iterators). Therefore, {@link Deque Deques} are a little more complex - * internally than {@link Vector Vectors}, but this allows them to grow more efficiently under certain - * circumstances, especially with very long sequences, where reallocations become more expensive.
+ *Specific libraries may implement deques in different ways, generally as some form of dynamic array. But in any + * case, they allow for the individual elements to be accessed directly through random access iterators, with storage + * handled automatically by expanding and contracting the container as needed.
* - *Both {@link Vector Vectors} and {@link Deque Deques} provide a very similar interface and can be used for - * similar purposes, but internally both work in quite different ways: While {@link Vector Vectors} use a single - * array that needs to be occasionally reallocated for growth, the elements of a {@link Deque} can be scattered - * in different chunks of storage, with the container keeping the necessary information internally to provide - * direct access to any of its elements in constant time and with a uniform sequential interface (through - * iterators). Therefore, {@link Deque Deques} are a little more complex internally than {@link Vector Vectors}, - * but this allows them to grow more efficiently under certain circumstances, especially with very long - * sequences, where reallocations become more expensive.
+ *Therefore, they provide a functionality similar to vectors, but with efficient insertion and deletion of + * elements also at the beginning of the sequence, and not only at its end. But, unlike {@link Vector Vectors}, + * {@link Deque Deques} are not guaranteed to store all its elements in contiguous storage locations: accessing + * elements in a deque by offsetting a pointer to another element causes undefined behavior.
* - *For operations that involve frequent insertion or removals of elements at positions other than the - * beginning or the end, {@link IArray} objects perform worse and have less consistent iterators and references - * than {@link List Lists}
. + *Both {@link Vector}s and {@link Deque}s provide a very similar interface and can be used for similar purposes, + * but internally both work in quite different ways: While {@link Vector}s use a single array that needs to be + * occasionally reallocated for growth, the elements of a {@link Deque} can be scattered in different chunks of + * storage, with the container keeping the necessary information internally to provide direct access to any of its + * elements in constant time and with a uniform sequential interface (through iterators). Therefore, + * {@link Deque Deques} are a little more complex internally than {@link Vector}s, but this allows them to grow more + * efficiently under certain circumstances, especially with very long sequences, where reallocations become more + * expensive.
+ * + *For operations that involve frequent insertion or removals of elements at positions other than the beginning or + * the end, {@link Deque Deques} perform worse and have less consistent iterators and references than + * {@link List Lists}.
* * + * + * * *Request a change in capacity.
- * - *Requests that the {@link IArray container} {@link capacity} be at least enough to contain - * n elements.
- * - *If n is greater than the current {@link IArray container} {@link capacity}, the - * function causes the {@link IArray container} to reallocate its storage increasing its - * {@link capacity} to n (or greater).
- * - *In all other cases, the function call does not cause a reallocation and the - * {@link IArray container} {@link capacity} is not affected.
- * - *This function has no effect on the {@link IArray container} {@link size} and cannot alter - * its elements.
- * - * @param n Minimum {@link capacity} for the {@link IArray container}. - * Note that the resulting {@link capacity} may be equal or greater than n. + * @hidden */ - reserve(n: number): void; + private static ROW; /** - *Return size of allocated storage capacity.
- * - *Returns the size of the storage space currently allocated for the {@link IArray container}, - * expressed in terms of elements.
- * - *This {@link capacity} is not necessarily equal to the {@link IArray container} {@link size}. - * It can be equal or greater, with the extra space allowing to accommodate for growth without the - * need to reallocate on each insertion.
+ * @hidden + */ + private static MIN_CAPACITY; + /** + * @hidden + */ + private matrix_; + /** + * @hidden + */ + private size_; + /** + * @hidden + */ + private capacity_; + /** + * @hidden + */ + private get_col_size(); + /** + *Default Constructor.
* - *Notice that this {@link capacity} does not suppose a limit on the {@link size} of the - * {@link IArray container}. When this {@link capacity} is exhausted and more is needed, it is - * automatically expanded by the {@link IArray container} (reallocating it storage space). - * The theoretical limit on the {@link size} of a {@link IArray container} is given by member - * {@link max_size}.
+ *Constructs an empty container, with no elements.
+ */ + constructor(); + /** + *Initializer list Constructor.
* - *The {@link capacity} of a {@link IArray container} can be explicitly altered by calling member - * {@link IArray.reserve}.
+ *Constructs a container with a copy of each of the elements in array, in the same order.
* - * @return The size of the currently allocated storage capacity in the {@link IArray container}, - * measured in terms of the number elements it can hold. + * @param array An array containing elements to be copied and contained. */ - capacity(): number; + constructor(items: ArrayAccess element.
- *Returns a value to the element at position index in the {@link IArray container}.
- * - *The function automatically checks whether index is within the bounds of valid elements - * in the {@link IArray container}, throwing an {@link OutOfRange} exception if it is not (i.e., - * if index is greater or equal than its {@link size}).
+ *Fill Constructor.
* - * @param index Position of an element in the - * If this is greater than or equal to the {@link IArray container} {@link size}, an - * exception of type {@link OutOfRange} is thrown. Notice that the first - * element has a position of 0 (not 1). + *Constructs a container with n elements. Each element is a copy of val (if provided).
* - * @return The element at the specified position in the + * @param n Initial container size (i.e., the number of elements in the container at construction). + * @param val Value to fill the container with. Each of the n elements in the container is + * initialized to a copy of this value. */ - at(index: number): T; + constructor(size: number, val: T); /** - *Modify element.
- *Replaces an element at the specified position (index) in this {@link IArray container} - * with the specified element (val).
- * - *The function automatically checks whether index is within the bounds of valid elements - * in the {@link IArray container}, throwing an {@link OutOfRange} exception if it is not (i.e., if - * index is greater or equal than its {@link size}).
+ *Copy Constructor.
* - * @.param index A specified position of the value to replace. - * @param val A value to be stored at the specified position. + *Constructs a container with a copy of each of the elements in container, in the same order.
* - * @return The previous element had stored at the specified position. + * @param container Another container object of the same type (with the same class template + * arguments T), whose contents are either copied or acquired. */ - set(index: number, val: T): void; - } -} -declare namespace std.base { - /** - *Random-access iterator.
- * - *{@link IArrayIterator Random-access iterators} are iterators that can be used to access elements at an - * arbitrary offset position relative to the element they point to, offering the same functionality as pointers. - *
- * - *{@link IArrayIterator Random-access iterators} are the most complete iterators in terms of functionality. - * All pointer types are also valid {@link IArrayIterator random-access iterators}.
- * - *There is not a single type of {@link IArrayIterator random-access iterator}: Each container may define its - * own specific iterator type able to iterate through it and access its elements.
- * - * - * - * @reference http://www.cplusplus.com/reference/iterator/RandomAccessIterator - * @author Jeongho NamRange Constructor.
* - * @return Sequence number of the iterator in the source {@link IArray array}. + *Constructs a container with as many elements as the range (begin, end), with each + * element emplace-constructed from its corresponding element in that range, in the same order.
+ * + * @param begin Input interator of the initial position in a sequence. + * @param end Input interator of the final position in a sequence. */ - index: number; + constructor(begin: IteratorAn interface of containers.
- * - *{@link IContainer} is an interface designed for sequence containers. Sequence containers of STL - * (Standard Template Library) are based on the {@link IContainer}.
- * - * - * - *Assign new content to content.
- * - *Assigns new contents to the container, replacing its current contents, and modifying its - * {@link size} accordingly.
- * - * @param begin Input interator of the initial position in a sequence. - * @param end Input interator of the final position in a sequence. + * @inheritdoc */ - assign>(begin: InputIterator, end: InputIterator): void; + reserve(capacity: number): void; /** - *Clear content.
- * - *Removes all elements from the Container, leaving the container with a size of 0.
+ * @inheritdoc */ clear(): void; /** - *Return iterator to beginning.
- * - *Returns an iterator referring the first element in the
- * - *If the container is {@link empty}, the returned iterator is same with {@link end end()}.
- * - * @return An iterator to the first element in the The iterator containes the first element's value. + * @inheritdoc */ - begin(): IteratorReturn iterator to end.
- *Returns an iterator referring to the past-the-end element in the
- * - *The past-the-end element is the theoretical element that would follow the last element in the - * It does not point to any element, and thus shall not be dereferenced.
- * - *Because the ranges used by functions of the Container do not include the element reference by their - * closing iterator, this function is often used in combination with {@link IContainer}.{@link begin} to - * specify a range including all the elements in the container.
- * - *Returned iterator from {@link IContainer}.{@link end} does not refer any element. Trying to accessing - * element by the iterator will cause throwing exception ({@link OutOfRange}).
- * - *If the container is {@link empty}, this function returns the same as {@link Container}.{@link begin}. - *
- * - * @return An iterator to the end element in the + * @inheritdoc */ - end(): IteratorReturn {@link ReverseIterator reverse iterator} to reverse beginning.
- * - *Returns a {@link ReverseIterator reverse iterator} pointing to the last element in the container (i.e., - * its reverse beginning).
- * - *{@link ReverseIterator reverse iterators} iterate backwards: increasing them moves them towards the - * beginning of the
- * - *{@link rbegin} points to the element right before the one that would be pointed to by member {@link end}. - *
- * - * @return A {@link ReverseIterator reverse iterator} to the reverse beginning of the sequence + * @inheritdoc */ - rbegin(): base.IReverseIteratorReturn {@link ReverseIterator reverse iterator} to reverse end.
- * - *Returns a {@link ReverseIterator reverse iterator} pointing to the theoretical element preceding the - * first element in the container (which is considered its reverse end).
- * - * The range between {@link IContainer}.{@link rbegin} and {@link IContainer}.{@link rend} contains all
- * the elements of the container (in reverse order).
- *
- * @return A {@link ReverseIterator reverse iterator} to the reverse end of the sequence
+ * @inheritdoc
*/
- rend(): base.IReverseIterator Test whether the container is empty. Returns whether the container is empty (i.e. whether its size is 0). This function does not modify the container in any way. To clear the content of the container,
- * see {@link clear clear()}. Insert elements. Appends new elements to the container, and returns the new size of the Insert an element. The container is extended by inserting a new element before the element at the specified
- * position. This effectively increases the {@link IContainer.size container size} by the amount of
- * elements inserted. Erase an element. Removes from the container a single element. This effectively reduces the container size by the number of element removed. Erase elements. Removes from the container a range of elements. This effectively reduces the container size by the number of elements removed. Swap content. Exchanges the content of the container by the content of obj, which is another
- * {@link IContainer container} object with same type of elements. Sizes and container type may differ. true
if the container size is 0, false
otherwise.
+ * @inheritdoc
*/
empty(): boolean;
/**
- *
After the call to this member function, the elements in this container are those which were in obj * before the call, and the elements of obj are those which were in this. All iterators, references and @@ -3999,1225 +3473,1008 @@ declare namespace std.base { *
Notice that a non-member function exists with the same name, {@link std.swap swap}, overloading that * algorithm with an optimization that behaves like this member function.
* - * @param obj Another {@link IContainer container} of the same type of elements (i.e., instantiated + * @param obj Another {@link Deque container} of the same type of elements (i.e., instantiated * with the same template parameter, T) whose content is swapped with that of this - * {@link container IContainer}. + * {@link container Deque}. */ - swap(obj: IContainerAn interface for deque
+ *An iterator of {@link Deque}.
* - * + *+ * + *
* * @author Jeongho NamInsert element at beginning.
+ * Sequence number of iterator in the source {@link Deque}. + */ + private index_; + /** + *Construct from the source {@link Deque container}.
* - *Inserts a new element at the beginning of the {@link IDeque container}, right before its - * current first element. This effectively increases the {@link IDeque container} {@link size} by - * one.
+ *Do not create the iterator directly, by yourself.
+ *Use {@link Deque.begin begin()}, {@link Deque.end end()} in {@link Deque container} instead.
* - * @param val Value to be inserted as an element. + * @param source The source {@link Deque container} to reference. + * @param index Sequence number of the element in the source {@link Deque}. */ - push_front(val: T): void; + constructor(source: DequeDelete first element.
- * - *Removes the first element in the {@link IDeque container}, effectively reducing its - * {@link size} by one.
+ * @hidden */ - pop_front(): void; - } -} -declare namespace std.base { - /** - *An interface for linear containers.
- * - *- * - *
- * - * @author Jeonngho Nam - */ - interface ILinearContainerAssign container content.
- * - *Assigns new contents to the {@link IList container}, replacing its current contents, - * and modifying its {@link size} accordingly.
+ * Set value of the iterator is pointing to. * - * @param n New size for the - * @param val Value to fill the container with. Each of the n elements in the container will - * be initialized to a copy of this value. + * @param val Value to set. */ - assign(n: number, val: T): void; + value: T; /** - *Access first element.
- *Returns a value of the first element in the {@link IList container}.
- * - *Unlike member {@link end end()}, which returns an iterator just past this element, - * this function returns a direct value.
- * - *Calling this function on an {@link empty} {@link IList container} causes undefined behavior.
- * - * @return A value of the first element of the {@link IList container}. + * @inheritdoc */ - front(): T; + index: number; /** - *Access last element.
- *Returns a value of the last element in the {@link IList container}.
- * - *Unlike member {@link end end()}, which returns an iterator just past this element, - * this function returns a direct value.
- * - *Calling this function on an {@link empty} {@link IList container} causes undefined behavior.
- * - * @return A value of the last element of the {@link IList container}. + * @inheritdoc */ - back(): T; + prev(): DequeIteratorAdd element at the end.
- * - *Adds a new element at the end of the {@link IList container}, after its current last element. - * This effectively increases the {@link IList container} {@link size} by one.
- * - * @param val Value to be copied to the new element. + * @inheritdoc */ - push_back(val: T): void; + next(): DequeIteratorDelete last element.
- * - *Removes the last element in the {@link IList container}, effectively reducing the - * {@link IList container} {@link size} by one.
+ * @inheritdoc */ - pop_back(): void; + advance(n: number): DequeIteratorInsert an element.
+ *Whether an iterator is equal with the iterator.
* - *The {@link IList conatiner} is extended by inserting new element before the element at the - * specified position, effectively increasing the {@link IList container} {@link size} by - * one.
+ *Compare two iterators and returns whether they are equal or not.
* - * @param position Position in the {@link IList container} where the new elements are inserted. - * {@link iterator} is a member type, defined as a {@link iterator random access iterator} - * type that points to elements. - * @param val Value to be copied to the inserted element. + *Iterator's equal_to() only compare souce container and index number.
* - * @return An iterator that points to the newly inserted element. - */ - insert(position: IteratorInsert elements by range iterators.
- * - *The {@link IList container} is extended by inserting new elements before the element at the - * specified position, effectively increasing the {@link IList container} {@link size} by - * the number of repeating elements n.
- * - * @param position Position in the {@link IList container} where the new elements are inserted. - * {@link iterator} is a member type, defined as a {@link iterator random access iterator} - * type that points to elements. - * @param n Number of elements to insert. Each element is initialized to a copy of val. - * @param val Value to be copied (or moved) to the inserted elements. + *Although elements in a pair, key and value are equal_to, if the source map or + * index number is different, then the {@link equal_to equal_to()} will return false. If you want to + * compare the elements of a pair, compare them directly by yourself.
* - * @return An iterator that points to the first of the newly inserted elements. + * @param obj An iterator to compare + * @return Indicates whether equal or not. */ - insert(position: IteratorInsert elements by range iterators.
- * - *The {@link IList container} is extended by inserting new elements before the element at the - * specified position, effectively increasing the {@link IList container} {@link size} by - * the number of elements inserted by range iterators.
- * - * @param position Position in the {@link IList container} where the new elements are inserted. - * {@link iterator} is a member type, defined as a {@link iterator random access iterator} - * type that points to elements. - * @param begin Input interator of the initial position in a sequence. - * @param end Input interator of the final position in a sequence. - * - * @return An iterator that points to the first of the newly inserted elements. + * @inheritdoc */ - insert>(position: IteratorBi-directional iterator.
- * - *{@link Iterator Bidirectional iterators} are iterators that can be used to access the sequence of elements - * in a range in both directions (towards the end and towards the beginning).
+ *A reverse-iterator of Deque.
* - *All {@link IArrayIterator random-access iterators} are also valid {@link Iterrator bidirectional iterators}. + *
+ * *
* - *There is not a single type of {@link Iterator bidirectional iterator}: {@link IContainer Each container} - * may define its own specific iterator type able to iterate through it and access its elements.
- * - *- * - *
+ * @paramGet iterator to previous element.
- *If current iterator is the first item(equal with {@link IContainer.begin IContainer.begin()}), - * returns {@link IContainer.end IContainer.end()}.
- * - * @return An iterator of the previous item. - */ - abstract prev(): IteratorGet iterator to next element.
- *If current iterator is the last item, returns {@link IContainer.end IContainer.end()}.
+ * Construct from base iterator. * - * @return An iterator of the next item. + * @param base A reference of the base iterator, which iterates in the opposite direction. */ - abstract next(): IteratorWhether an iterator is equal with the iterator.
- * - *Compare two iterators and returns whether they are equal or not.
- * - *Iterator's equal_to() only compare souce container and index number.
- * - *Although elements in a pair, key and value are equal_to, if the source map or - * index number is different, then the {@link equal_to equal_to()} will return false. If you want to - * compare the elements of a pair, compare them directly by yourself.
+ * Set value of the iterator is pointing to. * - * @param obj An iterator to compare - * @return Indicates whether equal or not. + * @param val Value to set. */ - equal_to(obj: Iterator): boolean; + value: T; /** - *Get value of the iterator is pointing.
- * - * @return A value of the iterator. + * Get index. */ - readonly value: T; - abstract swap(obj: IteratorThis class reverses the direction in which a bidirectional or random-access iterator iterates through a range. - *
+ *Function handling termination on exception
* - *A copy of the original iterator (the {@link Iterator base iterator}) is kept internally and used to reflect - * the operations performed on the {@link ReverseIterator}: whenever the {@link ReverseIterator} is incremented, its - * {@link Iterator base iterator} is decreased, and vice versa. A copy of the {@link Iterator base iterator} with the - * current state can be obtained at any time by calling member {@link base}.
+ *Calls the current terminate handler.
* - *Notice however that when an iterator is reversed, the reversed version does not point to the same element in - * the range, but to the one preceding it. This is so, in order to arrange for the past-the-end element of a - * range: An iterator pointing to a past-the-end element in a range, when reversed, is pointing to the last element - * (not past it) of the range (this would be the first element of the reversed range). And if an iterator to the - * first element in a range is reversed, the reversed iterator points to the element before the first element (this - * would be the past-the-end element of the reversed range).
+ *By default, the terminate handler calls abort. But this behavior can be redefined by calling + * {@link set_terminate}.
* - *- * - *
+ * This function is automatically called when no catch
handler can be found for a thrown exception,
+ * or for some other exceptional circumstance that makes impossible to continue the exception handling process.
This function is provided so that the terminate handler can be explicitly called by a program that needs to + * abnormally terminate, and works even if {@link set_terminate} has not been used to set a custom terminate handler + * (calling abort in this case).
+ */ + function terminate(): void; + /** + *Set terminate handler function.
+ * + *A terminate handler function is a function automatically called when the exception handling process has + * to be abandoned for some reason. This happens when no catch handler can be found for a thrown exception, or for + * some other exceptional circumstance that makes impossible to continue the exception handling process.
+ * + *Before this function is called by the program for the first time, the default behavior is to call abort.
+ * + *A program may explicitly call the current terminate handler function by calling {@link terminate}.
+ * + * @param f Function that takes no parameters and returns no value (void). + */ + function set_terminate(f: () => void): void; + /** + *Get terminate handler function.
+ * + * The terminate handler function is automatically called when no catch
handler can be found
+ * for a thrown exception, or for some other exceptional circumstance that makes impossible to continue the exception
+ * handling process.
If no such function has been set by a previous call to {@link set_terminate}, the function returns a + * null-pointer.
+ * + * @return If {@link set_terminate} has previously been called by the program, the function returns the current + * terminate handler function. Otherwise, it returns a null-pointer. + */ + function get_terminate(): () => void; + /** + *Standard exception class.
+ * + *Base class for standard exceptions.
+ * + *All objects thrown by components of the standard library are derived from this class. + * Therefore, all standard exceptions can be caught by catching this type by reference.
+ * + * + * + * @reference http://www.cplusplus.com/reference/exception/exception * @author Jeongho NamReturn base iterator.
- * - *Return a reference of the base iteraotr.
- * - *The base iterator is an iterator of the same type as the one used to construct the {@link ReverseIterator}, - * but pointing to the element next to the one the {@link ReverseIterator} is currently pointing to - * (a {@link ReverseIterator} has always an offset of -1 with respect to its base iterator). + *
Construct from a message.
* - * @return A reference of the base iterator, which iterates in the opposite direction. - */ - base(): Base; - /** - * @hidden + * @param message A message representing specification about the Exception. */ - protected abstract create_neighbor(base: Base): This; + constructor(message: string); /** - *Get value of the iterator is pointing.
+ *Get string identifying exception.
+ *Returns a string that may be used to identify the exception.
* - * @return A value of the reverse iterator. - */ - readonly value: T; - /** - * @inheritdoc - */ - prev(): This; - /** - * @inheritdoc - */ - next(): This; - /** - * @inheritdoc + *The particular representation pointed by the returned value is implementation-defined. + * As a virtual function, derived classes may redefine this function so that specify value are + * returned.
*/ - advance(n: number): This; + what(): string; /** * @inheritdoc */ - equal_to(obj: This): boolean; + message: string; /** * @inheritdoc */ - swap(obj: This): void; + name: string; } /** - *Return distance between {@link Iterator iterators}.
+ *Logic error exception.
* - *Calculates the number of elements between first and last.
+ *This class defines the type of objects thrown as exceptions to report errors in the internal + * logical of the program, such as violation of logical preconditions or class invariants.
* - *If it is a {@link IArrayIterator random-access iterator}, the function uses operator- to calculate this. - * Otherwise, the function uses the increase operator {@link Iterator.next next()} repeatedly.
+ *These errors are presumably detectable before the program executes.
* - * @param first Iterator pointing to the initial element. - * @param last Iterator pointing to the final element. This must be reachable from first. + *It is used as a base class for several logical error exceptions.
* - * @return The number of elements between first and last. + * + * + * @reference http://www.cplusplus.com/reference/stdexcept/logic_error + * @author Jeongho NamConstruct from a message.
+ * + * @param message A message representing specification about the Exception. + */ + constructor(message: string); + } /** - *Advance iterator.
+ *Domain error exception.
* - *Advances the iterator it by n elements positions.
- * - * @param it Iterator to be advanced. - * @param n Number of element positions to advance. + *This class defines the type of objects thrown as exceptions to report domain errors.
* - * @return An iterator to the element n positions before it. - */ - function advanceGet iterator to previous element.
+ *Generally, the domain of a mathematical function is the subset of values that it is defined for. + * For example, the square root function is only defined for non-negative numbers. Thus, a negative number + * for such a function would qualify as a domain error.
* - *Returns an iterator pointing to the element that it would be pointing to if advanced -n positions.
+ *No component of the standard library throws exceptions of this type. It is designed as a standard + * exception to be thrown by programs.
* - * @param it Iterator to base position. - * @param n Number of element positions offset (1 by default). + * * - * @return An iterator to the element n positions before it. + * @reference http://www.cplusplus.com/reference/stdexcept/domain_error + * @author Jeongho NamConstruct from a message.
+ * + * @param message A message representing specification about the Exception. + */ + constructor(message: string); + } /** - *Get iterator to next element.
+ *Invalid argument exception.
* - *Returns an iterator pointing to the element that it would be pointing to if advanced n positions.
+ *This class defines the type of objects thrown as exceptions to report an invalid argument.
* - * @param it Iterator to base position. - * @param n Number of element positions offset (1 by default). + *It is a standard exception that can be thrown by programs. Some components of the standard library + * also throw exceptions of this type to signal invalid arguments.
* - * @return An iterator to the element n positions away from it. + * + * + * @reference http://www.cplusplus.com/reference/stdexcept/invalid_argument + * @author Jeongho NamConstruct from a message.
+ * + * @param message A message representing specification about the Exception. + */ + constructor(message: string); + } /** - *Iterator to beginning.
+ *Length error exception.
* - *Returns an iterator pointing to the first element in the sequence.
+ *This class defines the type of objects thrown as exceptions to report a length error.
* - *If the sequence is empty, the returned value shall not be dereferenced.
+ *It is a standard exception that can be thrown by programs. Some components of the standard library, + * such as vector and string also throw exceptions of this type to signal errors resizing.
* - * @param container A container object of a class type for which member {@link IContainer.begin begin} is defined. + * * - * @return The same as returned by {@link IContainer.begin container.begin()}. + * @reference http://www.cplusplus.com/reference/stdexcept/length_error + * @author Jeongho NamConstruct from a message.
+ * + * @param message A message representing specification about the Exception. + */ + constructor(message: string); + } /** - *Iterator to beginning.
+ *Out-of-range exception.
* - *Returns an iterator pointing to the first element in the sequence.
+ *This class defines the type of objects thrown as exceptions to report an out-of-range error.
* - *If the sequence is empty, the returned value shall not be dereferenced.
+ *It is a standard exception that can be thrown by programs. Some components of the standard library, + * such as vector, deque, string and bitset also throw exceptions of this type to signal arguments + * out of range.
* - * @param container A container object of a class type for which member {@link IContainer.begin begin} is defined. + * * - * @return The same as returned by {@link IContainer.begin container.begin()}. + * @reference http://www.cplusplus.com/reference/stdexcept/out_of_range + * @author Jeongho NamConstruct from a message.
+ * + * @param message A message representing specification about the Exception. + */ + constructor(message: string); + } /** - *Iterator to beginning.
+ *Runtime error exception.
* - *Returns an iterator pointing to the first element in the sequence.
+ *This class defines the type of objects thrown as exceptions to report errors that can only be + * detected during runtime.
* - *If the sequence is empty, the returned value shall not be dereferenced.
+ *It is used as a base class for several runtime error exceptions.
* - * @param container A container object of a class type for which member {@link IContainer.begin begin} is defined. + * * - * @return The same as returned by {@link IContainer.begin container.begin()}. + * @reference http://www.cplusplus.com/reference/stdexcept/runtime_error + * @author Jeongho NamConstruct from a message.
+ * + * @param message A message representing specification about the Exception. + */ + constructor(message: string); + } /** - *Iterator to beginning.
+ *Overflow error exception.
* - *Returns an iterator pointing to the first element in the sequence.
+ *This class defines the type of objects thrown as exceptions to arithmetic overflow errors.
* - *If the sequence is empty, the returned value shall not be dereferenced.
+ *It is a standard exception that can be thrown by programs. Some components of the standard library + * also throw exceptions of this type to signal range errors.
* - * @param container A container object of a class type for which member {@link IContainer.begin begin} is defined. + * * - * @return The same as returned by {@link IContainer.begin container.begin()}. + * @reference http://www.cplusplus.com/reference/stdexcept/overflow_error + * @author Jeongho NamConstruct from a message.
+ * + * @param message A message representing specification about the Exception. + */ + constructor(message: string); + } /** - *Iterator to beginning.
+ *Underflow error exception.
* - *Returns an iterator pointing to the first element in the sequence.
+ *This class defines the type of objects thrown as exceptions to arithmetic underflow errors.
* - *If the sequence is empty, the returned value shall not be dereferenced.
+ *No component of the standard library throws exceptions of this type. It is designed as a standard + * exception to be thrown by programs.
* - * @param container A container object of a class type for which member {@link IContainer.begin begin} is defined. + * * - * @return The same as returned by {@link IContainer.begin container.begin()}. + * @reference http://www.cplusplus.com/reference/stdexcept/underflow_error + * @author Jeongho NamConstruct from a message.
+ * + * @param message A message representing specification about the Exception. + */ + constructor(message: string); + } /** - *Iterator to end.
+ *Range error exception.
* - *Returns an iterator pointing to the past-the-end element in the sequence.
+ *This class defines the type of objects thrown as exceptions to report range errors in internal + * computations.
* - *If the sequence is {@link IContainer.empty empty}, the returned value compares equal to the one returned by {@link begin} with the same argument.
+ *It is a standard exception that can be thrown by programs. Some components of the standard library + * also throw exceptions of this type to signal range errors.
* - * @param container A container of a class type for which member {@link IContainer.end end} is defined. + * * - * @return The same as returned by {@link IContainer.end container.end()}. + * @reference http://www.cplusplus.com/reference/stdexcept/range_error + * @author Jeongho NamConstruct from a message.
+ * + * @param message A message representing specification about the Exception. + */ + constructor(message: string); + } +} +declare namespace std { /** - *Iterator to end.
+ *Function object class for equality comparison.
* - *Returns an iterator pointing to the past-the-end element in the sequence.
+ *Binary function object class whose call returns whether its two arguments compare equal (as returned by + * operator ==).
* - *If the sequence is {@link IContainer.empty empty}, the returned value compares equal to the one returned by {@link begin} with the same argument.
+ *Generically, function objects are instances of a class with member function {@link IComparable.equal_to equal_to} + * defined. This member function allows the object to be used with the same syntax as a function call.
* - * @param container A container of a class type for which member {@link IContainer.end end} is defined. + * @param x First element to compare. + * @param y Second element to compare. * - * @return The same as returned by {@link IContainer.end container.end()}. + * @return Whether the arguments are equal. */ - function endIterator to end.
+ *Function object class for non-equality comparison.
* - *Returns an iterator pointing to the past-the-end element in the sequence.
+ *Binary function object class whose call returns whether its two arguments compare not equal (as returned + * by operator operator!=).
* - *If the sequence is {@link IContainer.empty empty}, the returned value compares equal to the one returned by {@link begin} with the same argument.
+ *Generically, function objects are instances of a class with member function {@link IComparable.equal_to equal_to} + * defined. This member function allows the object to be used with the same syntax as a function call.
* - * @param container A container of a class type for which member {@link IContainer.end end} is defined. + * @param x First element to compare. + * @param y Second element to compare. * - * @return The same as returned by {@link IContainer.end container.end()}. + * @return Whether the arguments are not equal. */ - function endIterator to end.
+ *Function for less-than inequality comparison.
* - *Returns an iterator pointing to the past-the-end element in the sequence.
+ *Binary function returns whether the its first argument compares less than the second.
* - *If the sequence is {@link IContainer.empty empty}, the returned value compares equal to the one returned by {@link begin} with the same argument.
+ *Generically, function objects are instances of a class with member function {@link IComparable.less less} + * defined. If an object doesn't have the method, then its own uid will be used to compare insteadly. + * This member function allows the object to be used with the same syntax as a function call.
* - * @param container A container of a class type for which member {@link IContainer.end end} is defined. + *Objects of this class can be used on standard algorithms such as {@link sort sort()}, + * {@link merge merge()} or {@link TreeMap.lower_bound lower_bound()}.
* - * @return The same as returned by {@link IContainer.end container.end()}. + * @paramIterator to end.
+ *Function object class for less-than-or-equal-to comparison.
* - *Returns an iterator pointing to the past-the-end element in the sequence.
+ *Binary function object class whose call returns whether the its first argument compares {@link less less than} or + * {@link equal_to equal to} the second (as returned by operator <=).
* - *If the sequence is {@link IContainer.empty empty}, the returned value compares equal to the one returned by {@link begin} with the same argument.
+ *Generically, function objects are instances of a class with member function {@link IComparable.less less} + * and {@link IComparable.equal_to equal_to} defined. This member function allows the object to be used with the same + * syntax as a function call.
* - * @param container A container of a class type for which member {@link IContainer.end end} is defined. + * @param x First element, the standard of comparison. + * @param y Second element compare with the first. * - * @return The same as returned by {@link IContainer.end container.end()}. + * @return Whether the x is {@link less less than} or {@link equal_to equal to} the y. */ - function endAn abstract map.
+ *Function for greater-than inequality comparison.
* - *{@link MapContainer MapContainers} are associative containers that store elements formed by a combination - * of a key value (Key) and a mapped value (T), and which allows for fast retrieval - * of individual elements based on their keys.
+ *Binary function returns whether the its first argument compares greater than the second.
* - *In a {@link MapContainer}, the key values are generally used to identify the elements, while the - * mapped values store the content associated to this key. The types of key and - * mapped value may differ, and are grouped together in member type value_type, which is a - * {@link Pair} type combining both:
+ *Generically, function objects are instances of a class with member function {@link less} and + * {@link equal_to equal_to()} defined. If an object doesn't have those methods, then its own uid will be used + * to compare insteadly. This member function allows the object to be used with the same syntax as a function + * call.
* - * typedef pair
Objects of this class can be used on standard algorithms such as {@link sort sort()}, + * {@link merge merge()} or {@link TreeMap.lower_bound lower_bound()}.
* - *{@link MapContainer} stores elements, keeps sequence and enables indexing by inserting elements into a - * {@link List} and registering {@link ListIterator iterators} of the {@link data_ list container} to an index - * table like {@link RBTree tree} or {@link HashBuckets hash-table}.
+ * @paramFunction object class for greater-than-or-equal-to comparison.
* - *Binary function object class whose call returns whether the its first argument compares + * {@link greater greater than} or {@link equal_to equal to} the second (as returned by operator >=).
* - *Generically, function objects are instances of a class with member function {@link IComparable.less less} + * defined. If an object doesn't have the method, then its own uid will be used to compare insteadly. + * This member function allows the object to be used with the same syntax as a function call.
* - * @paramLogical AND function object class.
+ * + *Binary function object class whose call returns the result of the logical "and" operation between its two + * arguments (as returned by operator &&).
+ * + *Generically, function objects are instances of a class with member function operator() defined. This member + * function allows the object to be used with the same syntax as a function call.
+ * + * @param x First element. + * @param y Second element. + * + * @return Result of logical AND operation. + */ + function logical_andLogical OR function object class.
+ * + *Binary function object class whose call returns the result of the logical "or" operation between its two + * arguments (as returned by operator ||).
+ * + *Generically, function objects are instances of a class with member function operator() defined. This member + * function allows the object to be used with the same syntax as a function call.
+ * + * @param x First element. + * @param y Second element. + * + * @return Result of logical OR operation. + */ + function logical_orLogical NOT function object class.
+ * + *Unary function object class whose call returns the result of the logical "not" operation on its argument + * (as returned by operator !).
+ * + *Generically, function objects are instances of a class with member function operator() defined. This member + * function allows the object to be used with the same syntax as a function call.
+ * + * @param x Target element. + * + * @return Result of logical NOT operation. + */ + function logical_notBitwise AND function object class.
+ * + *Binary function object class whose call returns the result of applying the bitwise "and" operation between + * its two arguments (as returned by operator &).
+ * + * @param x First element. + * @param y Second element. + * + * @return Result of bitwise AND operation. + */ + function bit_and(x: number, y: number): number; + /** + *Bitwise OR function object class.
+ * + *Binary function object class whose call returns the result of applying the bitwise "and" operation between + * its two arguments (as returned by operator &).
+ * + * @param x First element. + * @param y Second element. + * + * @return Result of bitwise OR operation. + */ + function bit_or(x: number, y: number): number; + /** + *Bitwise XOR function object class.
* + *Binary function object class whose call returns the result of applying the bitwise "exclusive or" + * operation between its two arguments (as returned by operator ^).
+ * + * @param x First element. + * @param y Second element. + * + * @return Result of bitwise XOR operation. + */ + function bit_xor(x: number, y: number): number; + /** + *Comparable instance.
+ * + *{@link IComparable} is a common interface for objects who can compare each other.
+ * + * @reference https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html * @author Jeongho Nam{@link List} storing elements.
- * - *Storing elements and keeping those sequence of the {@link MapContainer} are implemented by - * {@link data_ this list container}. Implementing index-table is also related with {@link data_ this list} - * by storing {@link ListIterator iterators} ({@link MapIterator} references {@link ListIterator}) who are - * created from {@link data_ here}.
- */ - private data_; - /** - * Default Constructor. - */ - constructor(); - /** - * @inheritdoc - */ - assignGet iterator to element.
+ *Indicates whether some other object is "equal to" this one.
* - *Searches the container for an element with a identifier equivalent to key and returns an - * iterator to it if found, otherwise it returns an iterator to {@link end end()}.
+ *The {@link equal_to} method implements an equivalence relation on non-null object references:
* - *Two keys are considered equivalent if the container's comparison object returns false reflexively - * (i.e., no matter the order in which the elements are passed as arguments).
+ *x
, x.equal_to(x)
+ * should return true
.
+ * x
and y
,
+ * x.equal_to(y)
should return true
if and only if y.equal_to(x)
+ * returns true
. x
, y
, and
+ * z
, if x.equal_to(y)
returns true
and y.equal_to(z)
+ * returns true
, then x.equal_to(z)
should return true
.
+ * x
and y
, multiple
+ * invocations of x.equal_to(y)
consistently return true
or consistently return
+ * false
, provided no information used in equal_to comparisons on the objects is modified.
+ * x
, x.equal_to(null)
should return
+ * false
.
+ * Another member functions, {@link has has()} and {@link count count()}, can be used to just check - * whether a particular key exists.
+ * The {@link equal_to} method for interface {@link IComparable} implements the most discriminating possible
+ * equivalence relation on objects; that is, for any non-null reference values x
and
+ * y
, this method returns true
if and only if x
and y
+ * refer to the same object (x == y
has the value true
).
Return iterator to beginning.
+ *Note that it is generally necessary to override the {@link hash_code} method whenever this method is + * overridden, so as to maintain the general contract for the {@link hash_code} method, which states that + * equal objects must have equal hash codes.
* - *Returns an iterator referring the first element in the
+ *If the container is {@link empty}, the returned iterator is same with {@link end end()}.
+ * @param obj the reference object with which to compare. * - * @return An iterator to the first element in the The iterator containes the first element's value. + * @returntrue
if this object is the same as the obj argument; false
otherwise.
*/
- begin(): MapIteratorReturn iterator to end.
- *Returns an iterator referring to the past-the-end element in the
- * - *The past-the-end element is the theoretical element that would follow the last element in the - * It does not point to any element, and thus shall not be dereferenced.
+ *Less-than inequality comparison.
* - *Because the ranges used by functions of the container do not include the element reference by their - * closing iterator, this function is often used in combination with {@link MapContainer}.{@link begin} to - * specify a range including all the elements in the
+ *Binary method returns whether the the instance compares less than the obj.
* - *Returned iterator from {@link MapContainer}.{@link end} does not refer any element. Trying to accessing - * element by the iterator will cause throwing exception ({@link OutOfRange}).
+ *If the container is {@link empty}, this function returns the same as {@link begin}.
+ * @param obj the reference object with which to compare. * - * @return An iterator to the end element in the + * @return Whether the first parameter is less than the second. */ - end(): MapIteratorReturn {@link MapReverseIterator reverse iterator} to reverse beginning.
- * - *Returns a {@link MapReverseIterator reverse iterator} pointing to the last element in the container - * (i.e., its reverse beginning).
+ *Issue a hash code.
* - * {@link MapReverseIterator Reverse iterators} iterate backwards: increasing them moves them towards the - * beginning of the container. - * - *{@link rbegin} points to the element preceding the one that would be pointed to by member {@link end}. - *
- * - * @return A {@link MapReverseIterator reverse iterator} to the reverse beginning of the sequence - * - */ - rbegin(): MapReverseIteratorReturn {@link MapReverseIterator reverse iterator} to reverse end.
- * - *Returns a {@link MapReverseIterator reverse iterator} pointing to the theoretical element right before - * the first element in the {@link MapContainer map container} (which is considered its reverse end). - *
- * - *The range between {@link MapContainer}.{@link rbegin} and {@link MapContainer}.{@link rend} contains - * all the elements of the container (in reverse order).
- * - * @return A {@link MapReverseIterator reverse iterator} to the reverse end of the sequence - */ - rend(): MapReverseIteratorWhether have the item or not.
- * - *Indicates whether a map has an item having the specified identifier.
- * - * @param key Key value of the element whose mapped value is accessed. - * - * @return Whether the map has an item having the specified identifier. - */ - has(key: Key): boolean; - /** - *Count elements with a specific key.
- * - *Searches the container for elements whose key is key and returns the number of elements found.
- * - * @param key Key value to be searched for. - * - * @return The number of elements in the container with a key. - */ - abstract count(key: Key): number; - /** - * Return the number of elements in the map. - */ - size(): number; - /** - * @inheritdoc - */ - pushInsert an element.
- * - *Extends the container by inserting a new element, effectively increasing the container {@link size} - * by the number of element inserted (zero or one).
- * - * @param hint Hint for the position where the element can be inserted. - * @param pair A single argument of a {@link Pair} type with a value for the *key* as - * {@link Pair.first first} member, and a *value* for the mapped value as - * {@link Pair.second second}. - * - * @return An iterator pointing to either the newly inserted element or to the element that already had an - * equivalent key in the {@link MapContainer}. - */ - insert(hint: MapIteratorInsert an element.
- * - *Extends the container by inserting a new element, effectively increasing the container {@link size} - * by the number of element inserted (zero or one).
- * - * @param hint Hint for the position where the element can be inserted. - * @param pair A single argument of a {@link Pair} type with a value for the *key* as - * {@link Pair.first first} member, and a *value* for the mapped value as - * {@link Pair.second second}. - * - * @return An iterator pointing to either the newly inserted element or to the element that already had an - * equivalent key in the {@link MapContainer}. - */ - insert(hint: MapReverseIteratorInsert an element.
- * - *Extends the container by inserting new elements, effectively increasing the container {@link size} - * by the number of elements inserted.
- * - * @param hint Hint for the position where the element can be inserted. - * @param tuple Tuple represensts the {@link Pair} to be inserted as an element. - * - * @return An iterator pointing to either the newly inserted element or to the element that already had an - * equivalent key in the {@link MapContainer}. - */ - insertInsert an element.
- * - *Extends the container by inserting new elements, effectively increasing the container {@link size} - * by the number of elements inserted.
- * - * @param hint Hint for the position where the element can be inserted. - * @param tuple Tuple represensts the {@link Pair} to be inserted as an element. - * - * @return An iterator pointing to either the newly inserted element or to the element that already had an - * equivalent key in the {@link MapContainer}. - */ - insertInsert elements from range iterators.
- * - *Extends the container by inserting new elements, effectively increasing the container {@link size} by - * the number of elements inserted.
- * - * @param begin Input iterator specifying initial position of a range of elements. - * @param end Input iterator specifying final position of a range of elements. - * Notice that the range includes all the elements between begin and end, - * including the element pointed by begin but not the one pointed by end. - */ - insertErase an elemet by key.
- * - *Removes from the {@link MapContainer map container} a single element.
- * - *This effectively reduces the container {@link size} by the number of element removed (zero or one), - * which are destroyed.
- * - * @param key Key of the element to be removed from the {@link MapContainer}. - */ - erase(key: Key): number; - /** - *Erase an elemet by iterator.
- * - *Removes from the {@link MapContainer map container} a single element.
- * - *This effectively reduces the container {@link size} by the number of element removed (zero or one), - * which are destroyed.
- * - * @param it Iterator specifying position winthin the {@link MapContainer map contaier} to be removed. - */ - erase(it: MapIteratorErase elements by range iterators.
- * - *Removes from the {@link MapContainer map container} a range of elements.
- * - *This effectively reduces the container {@link size} by the number of elements removed, which are - * destroyed.
- * - * @param begin An iterator specifying initial position of a range within {@link MApContainer map container} - * to be removed. - * @param end An iterator specifying initial position of a range within {@link MApContainer map container} - * to be removed. - * Notice that the range includes all the elements between begin and end, - * including the element pointed by begin but not the one pointed by end. - */ - erase(begin: MapIteratorErase an elemet by iterator.
- * - *Removes from the {@link MapContainer map container} a single element.
- * - *This effectively reduces the container {@link size} by the number of element removed (zero or one), - * which are destroyed.
- * - * @param it Iterator specifying position winthin the {@link MapContainer map contaier} to be removed. - */ - erase(it: MapReverseIteratorErase elements by range iterators.
- * - *Removes from the {@link MapContainer map container} a range of elements.
- * - *This effectively reduces the container {@link size} by the number of elements removed, which are - * destroyed.
- * - * @param begin An iterator specifying initial position of a range within {@link MApContainer map container} - * to be removed. - * @param end An iterator specifying initial position of a range within {@link MApContainer map container} - * to be removed. - * Notice that the range includes all the elements between begin and end, - * including the element pointed by begin but not the one pointed by end. - */ - erase(begin: MapReverseIteratorAbstract method handling insertions for indexing.
- * - *This method, {@link _Handle_insert} is designed to register the first to last to somewhere storing - * those {@link MapIterator iterators} for indexing, fast accessment and retrievalance.
- * - *When {@link insert} is called, new elements will be inserted into the {@link data_ list container} and new - * {@link MapIterator iterators} first to last, pointing the inserted elements, will be created and the - * newly created iterators first to last will be shifted into this method {@link _Handle_insert} after the - * insertions.
- * - *If the derived one is {@link RBTree tree-based} like {@link TreeSet}, the {@link MapIterator iterators} - * will be registered into the {@link TreeSet.tree_ tree} as a {@link XTreeNode tree node item}. Else if the - * derived one is {@link HashBuckets hash-based} like {@link HashSet}, the first to last will be - * registered into the {@link HashSet.hash_buckets_ hash bucket}.
- * - * @param first An {@link MapIterator} to the initial position in a sequence. - * @param last An {@link MapIterator} to the final position in a sequence. The range used is - * [first, last), which contains all the elements between first and last, - * including the element pointed by first but not the element pointed by last. - */ - protected abstract _Handle_insert(first: MapIteratorAbstract method handling deletions for indexing.
- * - *This method, {@link _Handle_erase} is designed to unregister the first to last to somewhere storing - * those {@link MapIterator iterators} for indexing, fast accessment and retrievalance.
+ *Returns a hash code value for the object. This method is supported for the benefit of hash tables such + * as those provided by hash containers; {@link HashSet}, {@link HashMap}, {@link MultiHashSet} and + * {@link MultiHashMap}.
* - *When {@link erase} is called with first to last, {@link MapIterator iterators} positioning somewhere - * place to be deleted, is memorized and shifted to this method {@link _Handle_erase} after the deletion process is - * terminated.
+ *As much as is reasonably practical, the {@link hash_code} method defined by interface + * {@link IComparable} does return distinct integers for distinct objects. (This is typically implemented by + * converting the internal address of the object into an integer, but this implementation technique is not + * required by the JavaScript programming language.)
* - *If the derived one is {@link RBTree tree-based} like {@link TreeSet}, the {@link MapIterator iterators} - * will be unregistered from the {@link TreeSet.tree_ tree} as a {@link XTreeNode tree node item}. Else if the - * derived one is {@link HashBuckets hash-based} like {@link HashSet}, the first to last will be - * unregistered from the {@link HashSet.hash_buckets_ hash bucket}.
+ *return std.Hash.code(this);
+ * An iterator of {@link MapContainer map container}.
+ *Default hash function for number.
* - * + *Unary function that defines the default hash function used by the standard library.
* - * @author Jeongho NamThe functional call returns a hash value of its argument: A hash value is a value that depends solely on + * its argument, returning always the same value for the same argument (for a given execution of a program). The + * value returned shall have a small likelihood of being the same as the one returned for a different argument. + *
+ * + * @param val Value to be hashed. + * + * @return Returns a hash value for its argument, as a value of type number. The number is an unsigned integer. */ - class MapIterator