Skip to content

Commit

Permalink
v1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeongho Nam committed Aug 11, 2016
1 parent 0d2a980 commit f04a7e7
Show file tree
Hide file tree
Showing 12 changed files with 2,599 additions and 2,318 deletions.
3 changes: 2 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ ts
wiki

*.bat
*.*ignore
*.*ignore
*.d.ts
89 changes: 81 additions & 8 deletions lib/typescript-stl.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2959,10 +2959,37 @@ declare namespace std {
* @author Jeongho Nam <http://samchon.org>
*/
abstract class ReverseIterator<T, Base extends Iterator<T>, This extends ReverseIterator<T, Base, This>> extends Iterator<T> {
/**
* @hidden
*/
protected base_: Base;
/**
* Construct from base iterator.
*
* @param base A reference of the base iterator, which iterates in the opposite direction.
*/
constructor(base: Base);
/**
* <p> Return base iterator. </p>
*
* <p> Return a reference of the base iteraotr. </p>
*
* <p> 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(): This;
/**
* <p> Get value of the iterator is pointing. </p>
*
* @return A value of the reverse iterator.
*/
value: T;
/**
* @inheritdoc
Expand Down Expand Up @@ -3463,6 +3490,11 @@ declare namespace std {
/**
* @inheritdoc
*/
/**
* Set value of the iterator is pointing to.
*
* @param val Value to set.
*/
value: T;
/**
* @inheritdoc
Expand Down Expand Up @@ -3515,13 +3547,20 @@ declare namespace std {
* @author Jeongho Nam <http://samchon.org>
*/
class DequeReverseIterator<T> extends ReverseIterator<T, DequeIterator<T>, DequeReverseIterator<T>> implements base.IArrayIterator<T> {
/**
* Construct from base iterator.
*
* @param base A reference of the base iterator, which iterates in the opposite direction.
*/
constructor(base: DequeIterator<T>);
/**
* @inheritdoc
* @hidden
*/
protected create_neighbor(): DequeReverseIterator<T>;
/**
* Set value.
* Set value of the iterator is pointing to.
*
* @param val Value to set.
*/
value: T;
/**
Expand Down Expand Up @@ -4851,7 +4890,15 @@ declare namespace std {
* @author Jeongho Nam <http://samchon.org>
*/
class MapReverseIterator<Key, T> extends ReverseIterator<Pair<Key, T>, MapIterator<Key, T>, MapReverseIterator<Key, T>> {
/**
* Construct from base iterator.
*
* @param base A reference of the base iterator, which iterates in the opposite direction.
*/
constructor(base: MapIterator<Key, T>);
/**
* @hidden
*/
protected create_neighbor(): MapReverseIterator<Key, T>;
/**
* Get first, key element.
Expand Down Expand Up @@ -5934,9 +5981,14 @@ declare namespace std {
* @author Jeongho Nam <http://samchon.org>
*/
class SetReverseIterator<T> extends ReverseIterator<T, SetIterator<T>, SetReverseIterator<T>> {
/**
* Construct from base iterator.
*
* @param base A reference of the base iterator, which iterates in the opposite direction.
*/
constructor(base: SetIterator<T>);
/**
* @inheritdoc
* @hidden
*/
protected create_neighbor(): SetReverseIterator<T>;
}
Expand Down Expand Up @@ -7106,6 +7158,11 @@ declare namespace std {
/**
* @inheritdoc
*/
/**
* Set value of the iterator is pointing to.
*
* @param val Value to set.
*/
value: T;
/**
* @inheritdoc
Expand All @@ -7130,13 +7187,20 @@ declare namespace std {
* @author Jeongho Nam <http://samchon.org>
*/
class ListReverseIterator<T> extends ReverseIterator<T, ListIterator<T>, ListReverseIterator<T>> {
/**
* Construct from base iterator.
*
* @param base A reference of the base iterator, which iterates in the opposite direction.
*/
constructor(base: ListIterator<T>);
/**
* @inheritdoc
* @hidden
*/
protected create_neighbor(): ListReverseIterator<T>;
/**
* @inheritdoc
* Set value of the iterator is pointing to.
*
* @param val Value to set.
*/
value: T;
}
Expand Down Expand Up @@ -9198,7 +9262,9 @@ declare namespace std {
* @inheritdoc
*/
/**
* Set value.
* Set value of the iterator is pointing to.
*
* @param val Value to set.
*/
value: T;
/**
Expand Down Expand Up @@ -9252,13 +9318,20 @@ declare namespace std {
* @author Jeongho Nam <http://samchon.org>
*/
class VectorReverseIterator<T> extends ReverseIterator<T, VectorIterator<T>, VectorReverseIterator<T>> implements base.IArrayIterator<T> {
/**
* Construct from base iterator.
*
* @param base A reference of the base iterator, which iterates in the opposite direction.
*/
constructor(base: VectorIterator<T>);
/**
* @inheritdoc
* @hidden
*/
protected create_neighbor(): VectorReverseIterator<T>;
/**
* Set value.
* Set value of the iterator is pointing to.
*
* @param val Value to set.
*/
value: T;
/**
Expand Down
83 changes: 75 additions & 8 deletions lib/typescript-stl.js
Original file line number Diff line number Diff line change
Expand Up @@ -2051,6 +2051,11 @@ var std;
/* ---------------------------------------------------------
CONSTRUCTORS
--------------------------------------------------------- */
/**
* Construct from base iterator.
*
* @param base A reference of the base iterator, which iterates in the opposite direction.
*/
function ReverseIterator(base) {
if (base == null)
_super.call(this, null);
Expand All @@ -2059,13 +2064,29 @@ var std;
this.base_ = base.prev();
}
}
/**
* <p> Return base iterator. </p>
*
* <p> Return a reference of the base iteraotr. </p>
*
* <p> 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.
*/
ReverseIterator.prototype.base = function () {
return this.base_.next();
};
Object.defineProperty(ReverseIterator.prototype, "value", {
/* ---------------------------------------------------------
ACCESSORS
--------------------------------------------------------- */
/**
* <p> Get value of the iterator is pointing. </p>
*
* @return A value of the reverse iterator.
*/
get: function () {
return this.base_.value;
},
Expand Down Expand Up @@ -2807,6 +2828,11 @@ var std;
get: function () {
return this.deque.at(this.index_);
},
/**
* Set value of the iterator is pointing to.
*
* @param val Value to set.
*/
set: function (val) {
this.deque.set(this.index_, val);
},
Expand Down Expand Up @@ -2906,11 +2932,16 @@ var std;
/* ---------------------------------------------------------
CONSTRUCTORS
--------------------------------------------------------- */
/**
* Construct from base iterator.
*
* @param base A reference of the base iterator, which iterates in the opposite direction.
*/
function DequeReverseIterator(base) {
_super.call(this, base);
}
/**
* @inheritdoc
* @hidden
*/
DequeReverseIterator.prototype.create_neighbor = function () {
return new DequeReverseIterator(null);
Expand All @@ -2920,7 +2951,9 @@ var std;
ACCESSORS
--------------------------------------------------------- */
/**
* Set value.
* Set value of the iterator is pointing to.
*
* @param val Value to set.
*/
set: function (val) {
this.base_.value = val;
Expand Down Expand Up @@ -4287,9 +4320,17 @@ var std;
/* ---------------------------------------------------------
CONSTRUCTORS
--------------------------------------------------------- */
/**
* Construct from base iterator.
*
* @param base A reference of the base iterator, which iterates in the opposite direction.
*/
function MapReverseIterator(base) {
_super.call(this, base);
}
/**
* @hidden
*/
MapReverseIterator.prototype.create_neighbor = function () {
return new MapReverseIterator(null);
};
Expand Down Expand Up @@ -5533,11 +5574,16 @@ var std;
/* ---------------------------------------------------------
CONSTRUCTORS
--------------------------------------------------------- */
/**
* Construct from base iterator.
*
* @param base A reference of the base iterator, which iterates in the opposite direction.
*/
function SetReverseIterator(base) {
_super.call(this, base);
}
/**
* @inheritdoc
* @hidden
*/
SetReverseIterator.prototype.create_neighbor = function () {
return new SetReverseIterator(null);
Expand Down Expand Up @@ -6815,6 +6861,11 @@ var std;
get: function () {
return this.value_;
},
/**
* Set value of the iterator is pointing to.
*
* @param val Value to set.
*/
set: function (val) {
this.value_ = val;
},
Expand Down Expand Up @@ -6871,11 +6922,16 @@ var std;
/* ---------------------------------------------------------------
CONSTRUCTORS
--------------------------------------------------------------- */
/**
* Construct from base iterator.
*
* @param base A reference of the base iterator, which iterates in the opposite direction.
*/
function ListReverseIterator(base) {
_super.call(this, base);
}
/**
* @inheritdoc
* @hidden
*/
ListReverseIterator.prototype.create_neighbor = function () {
return new ListReverseIterator(null);
Expand All @@ -6885,7 +6941,9 @@ var std;
ACCESSORS
--------------------------------------------------------- */
/**
* @inheritdoc
* Set value of the iterator is pointing to.
*
* @param val Value to set.
*/
set: function (val) {
this.base_.value = val;
Expand Down Expand Up @@ -9216,7 +9274,9 @@ var std;
return this.vector.at(this.index_);
},
/**
* Set value.
* Set value of the iterator is pointing to.
*
* @param val Value to set.
*/
set: function (val) {
this.vector.set(this.index_, val);
Expand Down Expand Up @@ -9317,11 +9377,16 @@ var std;
/* ---------------------------------------------------------
CONSTRUCTORS
--------------------------------------------------------- */
/**
* Construct from base iterator.
*
* @param base A reference of the base iterator, which iterates in the opposite direction.
*/
function VectorReverseIterator(base) {
_super.call(this, base);
}
/**
* @inheritdoc
* @hidden
*/
VectorReverseIterator.prototype.create_neighbor = function () {
return new VectorReverseIterator(null);
Expand All @@ -9331,7 +9396,9 @@ var std;
ACCESSORS
--------------------------------------------------------- */
/**
* Set value.
* Set value of the iterator is pointing to.
*
* @param val Value to set.
*/
set: function (val) {
this.base_.value = val;
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@
"email": "[email protected]",
"url": "http://samchon.org"
},
"version": "1.0.0-rc.8",
"version": "1.0.0",

"main": "./lib/typescript-stl.js",
"typings": "./lib/typescript-stl.d.ts",

"homepage": "https://github.com/samchon/typescript-stl",
"repository":
Expand Down
Loading

0 comments on commit f04a7e7

Please sign in to comment.