Skip to content

Commit ce0cea2

Browse files
committed
Realized interfaces Aggregate and Iterator
1 parent 7c97e34 commit ce0cea2

File tree

2 files changed

+76
-0
lines changed

2 files changed

+76
-0
lines changed

Aggregate/Aggregate.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/**
2+
* Created by Stefano on 04/04/2014.
3+
*/
4+
5+
function Aggregate() {
6+
7+
}
8+
9+
/**
10+
* Return the iterator relative to the aggregate.
11+
* @abstract
12+
* @return {Iterator} The iterator.
13+
*/
14+
Aggregate.prototype.getIterator = function () {
15+
};

Aggregate/Iterator.js

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
/**
2+
* Created by Stefano on 04/04/2014.
3+
*/
4+
5+
function Iterator() {
6+
7+
}
8+
9+
/**
10+
* Move the iterator to the first position of the aggregate.
11+
* @abstract
12+
* @return {void}
13+
*/
14+
Iterator.prototype.first = function () {
15+
16+
};
17+
18+
/**
19+
* Move the iterator to the next item.
20+
* @abstract
21+
* @return {void}
22+
*/
23+
Iterator.prototype.next = function () {
24+
25+
};
26+
27+
/**
28+
* Move the iterator to the last position of the aggregate.
29+
* @abstract
30+
* @return {void}
31+
*/
32+
Iterator.prototype.last = function () {
33+
34+
};
35+
36+
/**
37+
* Move the iterator to the previous item.
38+
* @abstract
39+
* @return {void}
40+
*/
41+
Iterator.prototype.previous = function () {
42+
43+
};
44+
45+
/**
46+
* Check if the iterator is out of the bounds of the aggregate.
47+
* @abstract
48+
* @return {boolean} It return true if the iterator is out of the bounds of the aggregate, otherwise false.
49+
*/
50+
Iterator.prototype.isDone = function () {
51+
52+
};
53+
54+
/**
55+
* Return the item stored at the position pointed by the iterator.
56+
* @abstract
57+
* @return {Object|undefined} The item stored or undefined if it's out of the bounds.
58+
*/
59+
Iterator.prototype.getItem = function () {
60+
61+
};

0 commit comments

Comments
 (0)