From 44e251d9b76d9c52273c037ce585ca2ccc8a15db Mon Sep 17 00:00:00 2001
From: Jeongho Nam Test condition on all elements in range. Test whether the elements in two ranges are equal. Test whether range is permutation of another. 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. Bi-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). 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.
- * 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()}. Get iterator to next element. If current iterator is the last item, returns {@link IContainer.end IContainer.end()}. Whether 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. Get value of the iterator is pointing. 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).
- * Return 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).
- *
- * @return A reference of the base iterator, which iterates in the opposite direction.
- */
- base(): Base;
- /**
- * @hidden
- */
- protected abstract create_neighbor(base: Base): This;
- /**
- * Get value of the iterator is pointing. Return distance between {@link Iterator iterators}. Calculates the number of elements between first and last. 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. Advance iterator. Advances the iterator it by n elements positions. Get iterator to previous element. Returns an iterator pointing to the element that it would be pointing to if advanced -n positions. 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. Returns an iterator pointing to the first element in the sequence. If the sequence is empty, the returned value shall not be dereferenced. Iterator 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. Iterator 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. Iterator 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. Iterator 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. Iterator 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. Iterator 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. Iterator 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. Iterator 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. Iterator 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. Double ended queue. {@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). 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. 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. 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}.
- * Default Constructor. Constructs an empty container, with no elements. Initializer list Constructor. Constructs a container with a copy of each of the elements in array, in the same order. Fill Constructor. Constructs a container with n elements. Each element is a copy of val (if provided). Copy Constructor. Constructs a container with a copy of each of the elements in container, in the same order. Range Constructor. 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. Swap content. Exchanges the content of the container by the content of obj, which is another
- * {@link Deque container} object with same type of elements. Sizes and container type may differ. 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
- * pointers remain valid for the swapped objects. 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. An iterator of {@link Deque}.
- * Construct from the source {@link Deque container}. Do not create the iterator directly, by yourself. Use {@link Deque.begin begin()}, {@link Deque.end end()} in {@link Deque container} instead. Whether 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. A reverse-iterator of Deque.
- * Function handling termination on exception Calls the current terminate handler. 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 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). 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}. Get terminate handler function. The terminate handler function is automatically called when no If no such function has been set by a previous call to {@link set_terminate}, the function returns a
- * null-pointer. 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. Construct from a message. Get string identifying exception. Returns a string that may be used to identify the exception. 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. Logic error exception. 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. These errors are presumably detectable before the program executes. It is used as a base class for several logical error exceptions. Construct from a message. Domain error exception. This class defines the type of objects thrown as exceptions to report domain errors. 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. No component of the standard library throws exceptions of this type. It is designed as a standard
- * exception to be thrown by programs. Construct from a message. Invalid argument exception. This class defines the type of objects thrown as exceptions to report an invalid 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 invalid arguments. Construct from a message. Length error exception. This class defines the type of objects thrown as exceptions to report a length error. 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. Construct from a message. Out-of-range exception. This class defines the type of objects thrown as exceptions to report an out-of-range error. 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. Construct from a message. Runtime error exception. This class defines the type of objects thrown as exceptions to report errors that can only be
- * detected during runtime. It is used as a base class for several runtime error exceptions. Construct from a message. Overflow error exception. This class defines the type of objects thrown as exceptions to arithmetic overflow errors. 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. Construct from a message. Underflow error exception. This class defines the type of objects thrown as exceptions to arithmetic underflow errors. No component of the standard library throws exceptions of this type. It is designed as a standard
- * exception to be thrown by programs. Construct from a message. Range error exception. This class defines the type of objects thrown as exceptions to report range errors in internal
- * computations. 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. Construct from a message. Function object class for equality comparison. Binary function object class whose call returns whether its two arguments compare equal (as returned by
- * operator ==). 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. Function object class for non-equality comparison. Binary function object class whose call returns whether its two arguments compare not equal (as returned
- * by operator operator!=). 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. Function for less-than inequality comparison. Binary function returns whether the its first argument compares less than the second. 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. 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()}. Function object class for less-than-or-equal-to comparison. 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 <=). 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. Function for greater-than inequality comparison. Binary function returns whether the its first argument compares greater than the second. 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. 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()}. Function 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. Logical 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. Logical 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. Logical 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. Bitwise 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 &). 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 &). 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 ^). Comparable instance. {@link IComparable} is a common interface for objects who can compare each other. Indicates whether some other object is "equal to" this one. The {@link equal_to} method implements an equivalence relation on non-null object references: 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 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. Less-than inequality comparison. Binary method returns whether the the instance compares less than the obj. Issue a hash code. 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}. 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.) Default hash function for number. Unary function that defines the default hash function used by the standard library. The 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.
- * Default hash function for string. Unary function that defines the default hash function used by the standard library. The 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.
- * Default hash function for Object. Unary function that defines the default hash function used by the standard library. The 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.
- * The default {@link hash} function of Object returns a value returned from {@link hash hash(number)} with
- * an unique id of each Object. If you want to specify {@link hash} function of a specific class, then
- * define a member function Exchange contents of {@link IContainers containers}. The contents of container left are exchanged with those of right. Both container objects must have
- * same type of elements (same template parameters), although sizes may differ. After the call to this member function, the elements in left are those which were in right before
- * the call, and the elements of right are those which were in left. All iterators, references and
- * pointers remain valid for the swapped objects. This is an overload of the generic algorithm swap that improves its performance by mutually transferring
- * ownership over their assets to the other container (i.e., the containers exchange references to their data, without
- * actually performing any element copy or movement): It behaves as if left.
- * {@link IContainer.swap swap}(right) was called. Exchange contents of queues. Exchanges the contents of left and right. Exchange contents of {@link PriorityQueue PriorityQueues}. Exchanges the contents of left and right. Exchange contents of {@link Stack Stacks}. Exchanges the contents of left and right. Exchanges the contents of two {@link UniqueMap unique maps}. The contents of container left are exchanged with those of right. Both container objects must
- * be of the same type (same template parameters), although sizes may differ. After the call to this member function, the elements in left are those which were in right
- * before the call, and the elements of right are those which were in left. All iterators, references
- * and pointers remain valid for the swapped objects. This is an overload of the generic algorithm swap that improves its performance by mutually transferring
- * ownership over their assets to the other container (i.e., the containers exchange references to their data,
- * without actually performing any element copy or movement): It behaves as if
- * left.{@link UniqueMap.swap swap}(right) was called. Exchanges the contents of two {@link MultiMap multi maps}. The contents of container left are exchanged with those of right. Both container objects must
- * be of the same type (same template parameters), although sizes may differ. After the call to this member function, the elements in left are those which were in right
- * before the call, and the elements of right are those which were in left. All iterators, references
- * and pointers remain valid for the swapped objects. This is an overload of the generic algorithm swap that improves its performance by mutually transferring
- * ownership over their assets to the other container (i.e., the containers exchange references to their data,
- * without actually performing any element copy or movement): It behaves as if
- * left.{@link MultiMap.swap swap}(right) was called. Bind function arguments. Returns a function object based on fn, but with its arguments bound to args. Each argument may either be bound to a value or be a {@link placeholders placeholder}: Calling the returned object returns the same type as fn. Bind function arguments. Returns a function object based on fn, but with its arguments bound to args. Each argument may either be bound to a value or be a {@link placeholders placeholder}: Calling the returned object returns the same type as fn. Bind argument placeholders. This namespace declares an unspecified number of objects: _1, _2, _3, ..., which are
- * used to specify placeholders in calls to function {@link std.bind}. When the function object returned by bind is called, an argument with placeholder {@link _1} is replaced by the
- * first argument in the call, {@link _2} is replaced by the second argument in the call, and so on... For example: When a call to {@link bind} is used as a subexpression in another call to bind, the {@link placeholders}
- * are relative to the outermost {@link bind} expression. An abstract map. {@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. 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: {@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}. {@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}. Get iterator to element. 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()}. 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). Another member functions, {@link has has()} and {@link count count()}, can be used to just check
- * whether a particular key exists. 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 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 MapContainer}.{@link begin} to
- * specify a range including all the elements in the 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}. Return {@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). true if all the elements in the range [first1, last1) compare equal to those
* of the range starting at first2, and false otherwise.
*/
- function equaltrue if all the elements in the range [first1, last1) compare equal to those
* of the range starting at first2, and false otherwise.
*/
- function equal
+ *
+ *
+ * @author Migrated by Jeongho Nam null) are black.
+ *
+ */
+ BLACK = 0,
+ /**
+ *
- * Note
- *
- *
- * Container properties
- *
- *
- *
- * @param
- * Note
- * Note
- *
- * catch handler can be found for a thrown exception,
- * or for some other exceptional circumstance that makes impossible to continue the exception handling process. catch handler can be found
- * for a thrown exception, or for some other exceptional circumstance that makes impossible to continue the exception
- * handling process.
- *
- *
- * 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.
- * 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).
- *
- *
- * @param obj the reference object with which to compare.
- *
- * @return true if this object is the same as the obj argument; false otherwise.
- */
- equal_to(obj: T): boolean;
- /**
- *
- *
- *
- * @param obj the reference object with which to compare.
- *
- * @return Whether the first parameter is less than the second.
- */
- less(obj: T): boolean;
- /**
- *
- *
- *
- * @return An hash code who represents the object.
- */
- hash(): number;
- }
- /**
- * return std.Hash.code(this);
- * public hash(): number in the class.
- *
- *
- *
- *
- *
- *
- * let vec: Vector
- *
- * typedef pair Container properties
- *
- *
- *
- * @param Note
- * Note
- *
{@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; - protected _Get_data(): ListInsert 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 {@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}. - */ - 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 {@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}. - */ - 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_insert} is designed to unregister the first to last to somewhere storing - * those {@link MapIterator iterators} for indexing, fast accessment and retrievalance.
- * - *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.
- * - *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}.
- * - * @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_erase(first: MapIteratorAn iterator of {@link MapContainer map container}.
- * - * - * - * @author Jeongho NamWhether an iterator is equal with the iterator.
- * - *Compare two iterators and returns whether they are equal or not.
- * - * @param obj An iterator to compare - * @return Indicates whether equal or not. - */ - equal_toA reverse-iterator of {@link MapContainer map container}.
- * - * - * - * @author Jeongho NamAn abstract unique-map.
- * - *{@link UniqueMap UniqueMaps} 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.
- * - *In a {@link MapContainer}, the key values are generally used to uniquely 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:
- * - * typedef pair
{@link UniqueMap} 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}.
- * - * - * - *Get an element
- * - *Returns a reference to the mapped value of the element identified with key.
- * - * @param key Key value of the element whose mapped value is accessed. - * - * @throw exception out of range - * - * @return A reference object of the mapped value (_Ty) - */ - get(key: Key): T; - /** - *Set an item as the specified identifier.
- * - *If the identifier is already in map, change value of the identifier. If not, then insert the object - * with the identifier.
- * - * @param key Key value of the element whose mapped value is accessed. - * @param val Value, the item. - */ - set(key: Key, val: T): void; - /** - *Extract an element.
- * - *Extracts the element pointed to by key and erases it from the {@link UniqueMap}.
- * - * @param key Key value of the element whose mapped value is accessed. - * - * @return A {@link Pair} containing the value pointed to by key. - */ - extract(key: Key): PairExtract an element.
- * - *Extracts the element pointed to by key and erases it from the {@link UniqueMap}.
- * - * @param it An iterator pointing an element to extract. - * - * @return An iterator pointing to the element immediately following it prior to the element being - * erased. If no such element exists,returns {@link end end()}. - */ - extract(it: MapIteratorExtract an element.
- * - *Extracts the element pointed to by key and erases it from the {@link UniqueMap}.
- * - * @param it An iterator pointing an element to extract. - * - * @return An iterator pointing to the element immediately following it prior to the element being - * erased. If no such element exists,returns {@link end end()}. - */ - extract(it: MapReverseIteratorInsert an element.
- * - *Extends the container by inserting new elements, effectively increasing the container {@link size} by - * one.
- * - *Because element keys in a {@link UniqueMap} are unique, the insertion operation checks whether - * each inserted element has a key equivalent to the one of an element already in the container, and - * if so, the element is not inserted, returning an iterator to this existing element (if the function - * returns a value).
- * - *For a similar container allowing for duplicate elements, see {@link MultiMap}.
- * - * @param pair {@link Pair} to be inserted as an element. - * - * @return A {@link Pair}, with its member {@link Pair.first} set to an iterator pointing to either the newly - * inserted element or to the element with an equivalent key in the {@link UniqueMap}. The - * {@link Pair.second} element in the {@link Pair} is set to true if a new element was inserted or - * false if an equivalent key already existed. - */ - insert(pair: PairInsert an element.
- * - *Extends the container by inserting a new element, effectively increasing the container size by the - * number of elements inserted.
- * - *Because element keys in a {@link UniqueMap} are unique, the insertion operation checks whether - * each inserted element has a key equivalent to the one of an element already in the container, and - * if so, the element is not inserted, returning an iterator to this existing element (if the function - * returns a value).
- * - *For a similar container allowing for duplicate elements, see {@link MultiMap}.
- * - * @param tuple Tuple represensts the {@link Pair} to be inserted as an element. - * - * @return A {@link Pair}, with its member {@link Pair.first} set to an iterator pointing to either the newly - * inserted element or to the element with an equivalent key in the {@link UniqueMap}. The - * {@link Pair.second} element in the {@link Pair} is set to true if a new element was inserted or - * false if an equivalent key already existed. - */ - insertInsert or assign an element.
- * - *Inserts an element or assigns to the current element if the key already exists.
- * - *Because element keys in a {@link UniqueMap} are unique, the insertion operation checks whether - * each inserted element has a key equivalent to the one of an element already in the container, and - * if so, the element is assigned, returning an iterator to this existing element (if the function returns a - * value).
- * - *For a similar container allowing for duplicate elements, see {@link MultiMap}.
- * - * @param key The key used both to look up and to insert if not found. - * @param value Value, the item. - * - * @return A {@link Pair}, with its member {@link Pair.first} set to an iterator pointing to either the newly - * inserted element or to the element with an equivalent key in the {@link UniqueMap}. The - * {@link Pair.second} element in the {@link Pair} is set to true if a new element was inserted or - * false if an equivalent key already existed so the value is assigned. - */ - insert_or_assign(key: Key, value: T): PairInsert or assign an element.
- * - *Inserts an element or assigns to the current element if the key already exists.
- * - *Because element keys in a {@link UniqueMap} are unique, the insertion operation checks whether - * each inserted element has a key equivalent to the one of an element already in the container, and - * if so, the element is assigned, returning an iterator to this existing element (if the function returns a - * value).
- * - *For a similar container allowing for duplicate elements, see {@link MultiMap}.
- * - * @param hint Hint for the position where the element can be inserted. - * @param key The key used both to look up and to insert if not found. - * @param value Value, the item. - * - * @return An iterator pointing to either the newly inserted element or to the element that already had an - * equivalent key in the {@link UniqueMap}. - */ - insert_or_assign(hint: MapIteratorInsert or assign an element.
- * - *Inserts an element or assigns to the current element if the key already exists.
- * - *Because element keys in a {@link UniqueMap} are unique, the insertion operation checks whether - * each inserted element has a key equivalent to the one of an element already in the container, and - * if so, the element is assigned, returning an iterator to this existing element (if the function returns a - * value).
- * - *For a similar container allowing for duplicate elements, see {@link MultiMap}.
- * - * @param hint Hint for the position where the element can be inserted. - * @param key The key used both to look up and to insert if not found. - * @param value Value, the item. - * - * @return An iterator pointing to either the newly inserted element or to the element that already had an - * equivalent key in the {@link UniqueMap}. - */ - insert_or_assign(hint: MapReverseIteratorAn abstract multi-map.
- * - *{@link MultiMap MultiMaps} 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.
- * - *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:
- * - * typedef pair
{@link UniqueMap} 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}.
- * - * - * - *Insert elements.
- * - *Extends the container by inserting new elements, effectively increasing the container {@link size} by - * the number of elements inserted.
- * - * @param pair {@link Pair} to be inserted as an element. - * - * @return An iterator pointing to the newly inserted element. - */ - insert(pair: PairInsert elements.
- * - *Extends the container by inserting new elements, effectively increasing the container {@link size} by - * the number of elements inserted.
- * - * @param tuple Tuple represensts the {@link Pair} to be inserted as an element. - * - * @return An iterator pointing to the newly inserted element. - */ - insertHashed, unordered map.
- * - *{@link HashMap}s are associative containers that store elements formed by the combination of a key value - * and a mapped value, and which allows for fast retrieval of individual elements based on their keys. - *
- * - *In an {@link HashMap}, 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 HashMap} 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).
- * - *{@link HashMap} containers are faster than {@link TreeMap} containers to access individual elements by their - * key, although they are generally less efficient for range iteration through a subset of their elements.
- * - *
- *
- *
Swap content.
- * - *Exchanges the content of the container by the content of obj, which is another - * {@link HashMap map} of the same type. Sizes abd container type may differ.
- * - *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 pointers remain valid for the swapped objects.
- * - *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 HashMap map container} of the same type of elements as this (i.e., - * with the same template parameters, Key and T) whose content is swapped - * with that of this {@link HashMap container}. - */ - swap(obj: HashMapHashed, unordered Multimap.
- * - *{@link HashMultiMap}s are associative containers that store elements formed by the combination of - * a key value and a mapped value, much like {@link HashMultiMap} containers, but allowing - * different elements to have equivalent keys.
- * - *In an {@link HashMultiMap}, 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 HashMultiMap} 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.
- * - *
- *
- *
Swap content.
- * - *Exchanges the content of the container by the content of obj, which is another - * {@link HashMultiMap map} of the same type. Sizes abd container type may differ.
- * - *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 pointers remain valid for the swapped objects.
- * - *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 HashMultiMap map container} of the same type of elements as this (i.e., - * with the same template parameters, Key and T) whose content is swapped - * with that of this {@link HashMultiMap container}. - */ - swap(obj: HashMultiMapAn abstract set.
- * - *{@link SetContainer SetContainers} are containers that store elements allowing fast retrieval of - * individual elements based on their value.
- * - *In an {@link SetContainer}, the value of an element is at the same time its key, used to - * identify it. Keys are immutable, therefore, the elements in an {@link SetContainer} cannot be - * modified once in the container - they can be inserted and removed, though.
- * - *{@link SetContainer} 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}.
- * - * - * - *{@link List} storing elements.
- * - *Storing elements and keeping those sequence of the {@link SetContainer} 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 SetIterator} references {@link ListIterator}) who are - * created from {@link data_ here}.
- */ - private data_; - /** - * Default Constructor. - */ - constructor(); - /** - * @inheritdoc - */ - assign>(begin: Iterator, end: Iterator): void; - /** - * @inheritdoc - */ - clear(): void; - /** - *Get iterator to element.
- * - *Searches the container for an element with key as value and returns an iterator to it if found, - * otherwise it returns an iterator to {@link end end()} (the element past the end of the container).
- * - *Another member function, {@link count count()}, can be used to just check whether a particular element - * exists.
- * - * @param key Key to be searched for. - * - * @return An iterator to the element, if the specified value is found, or {@link end end()} if it is not - * found in the - */ - abstract find(val: T): SetIteratorWhether have the item or not.
- * - *Indicates whether a set has an item having the specified identifier.
- * - * @param key Key value of the element whose mapped value is accessed. - * - * @return Whether the set has an item having the specified identifier. - */ - has(val: T): boolean; - /** - *Count elements with a specific key.
- * - *Searches the container for elements with a value of k and returns the number of elements found.
- * - * @param key Value of the elements to be counted. - * - * @return The number of elements in the container with a key. - */ - abstract count(val: T): number; - /** - * @inheritdoc - */ - size(): number; - /** - * @hidden - */ - _Get_data(): ListInsert an element with hint.
- * - *Extends the container by inserting new elements, effectively increasing the container size by the - * number of elements inserted.
- * - * @param hint Hint for the position where the element can be inserted. - * @param val Value to be inserted as an element. - * - * @return An iterator pointing to either the newly inserted element or to the element that already had its - * same value in the {@link SetContainer}. - */ - insert(hint: SetIteratorInsert an element with hint.
- * - *Extends the container by inserting new elements, effectively increasing the container size by the - * number of elements inserted.
- * - * @param hint Hint for the position where the element can be inserted. - * @param val Value to be inserted as an element. - * - * @return An iterator pointing to either the newly inserted element or to the element that already had its - * same value in the {@link SetContainer}. - */ - insert(hint: SetReverseIteratorInsert elements with a range of a
- * - *Extends the container by inserting new elements, effectively increasing the container size by the - * number of elements inserted.
- * - * @param begin An iterator specifying range of the begining element. - * @param end An iterator specifying range of the ending element. - */ - insert>(begin: InputIterator, end: InputIterator): void; - /** - * @hidden - */ - protected abstract _Insert_by_val(val: T): any; - /** - * @hidden - */ - protected abstract _Insert_by_hint(hint: SetIteratorErase an element.
- *Removes from the set container the elements whose value is key.
- * - *This effectively reduces the container size by the number of elements removed.
- * - * @param key Value of the elements to be erased. - * - * @return Number of elements erased. - */ - erase(val: T): number; - /** - * @inheritdoc - */ - erase(it: SetIteratorErase elements.
- *Removes from the set container a range of elements..
- * - *This effectively reduces the container size by the number of elements removed.
- * - * @param begin An iterator specifying a range of beginning to erase. - * @param end An iterator specifying a range of end to erase. - */ - erase(begin: SetIteratorErase elements.
- *Removes from the set container a range of elements..
- * - *This effectively reduces the container size by the number of elements removed.
- * - * @param begin An iterator specifying a range of beginning to erase. - * @param end An iterator specifying a range of end to erase. - */ - erase(begin: SetReverseIteratorAbstract method handling insertions for indexing.
- * - *This method, {@link handle_insert} is designed to register the first to last to somewhere storing - * those {@link SetIterator 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 SetIterator 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 SetIterator 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 SetIterator} to the initial position in a sequence. - * @param last An {@link SetIterator} 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: SetIteratorAbstract method handling deletions for indexing.
- * - *This method, {@link handle_insert} is designed to unregister the first to last to somewhere storing - * those {@link SetIterator iterators} for indexing, fast accessment and retrievalance.
- * - *When {@link erase} is called with first to last, {@link SetIterator iterators} positioning somewhere - * place to be deleted, is memorized and shifted to this method {@link handle_erase} after the deletion process is - * terminated.
- * - *If the derived one is {@link RBTree tree-based} like {@link TreeSet}, the {@link SetIterator 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}.
- * - * @param first An {@link SetIterator} to the initial position in a sequence. - * @param last An {@link SetIterator} 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_erase(first: SetIteratorAn iterator of a Set.
- * - * - * - * @author Jeongho NamConstruct from source and index number.
- * - *Do not create iterator directly.
- *Use begin(), find() or end() in Map instead.
- * - * @param map The source Set to reference. - * @param index Sequence number of the element in the source Set. - */ - constructor(source: base.SetContainerA reverse-iterator of Set.
- * - * - * - * @paramAn abstract set.
- * - *{@link SetContainer SetContainers} are containers that store elements allowing fast retrieval of - * individual elements based on their value.
- * - *In an {@link SetContainer}, the value of an element is at the same time its key, used to - * identify it. Keys are immutable, therefore, the elements in an {@link SetContainer} cannot be - * modified once in the container - they can be inserted and removed, though.
- * - *{@link SetContainer} 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}.
- * - * - * - *Insert an element.
- * - *Extends the container by inserting new elements, effectively increasing the container {@link size} by - * the number of elements inserted.
- * - * @param key Value to be inserted as an element. - * - * @return An iterator to the newly inserted element. - */ - insert(val: T): SetIterator