-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added RsStream>>#iterator and #reverseIteraror for supporting easiler…
… iteration
- Loading branch information
Showing
19 changed files
with
52 additions
and
11 deletions.
There are no files selected for viewing
3 changes: 3 additions & 0 deletions
3
repository/RediStick-Stream-Objects.package/RsStream.class/instance/iterator.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
iterating | ||
iterator | ||
^ self iteratorClass on: self |
3 changes: 3 additions & 0 deletions
3
repository/RediStick-Stream-Objects.package/RsStream.class/instance/reverseIterator.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
iterating | ||
reverseIterator | ||
^ self iterator reversed |
5 changes: 5 additions & 0 deletions
5
repository/RediStick-Stream-Objects.package/RsStreamIterator.class/class/on.from..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
instance creation | ||
on: aRsStream from: fromId | ||
^ (self on: aRsStream) | ||
initFromId: fromId; | ||
yourself |
5 changes: 4 additions & 1 deletion
5
repository/RediStick-Stream-Objects.package/RsStreamIterator.class/class/on.nextFrom..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
instance creation | ||
on: aRsStream nextFrom: fromId | ||
^ (self on: aRsStream) initFromId: fromId | ||
^ (self on: aRsStream) | ||
initFromId: fromId; | ||
initCurrentId: fromId; | ||
yourself |
3 changes: 3 additions & 0 deletions
3
...sitory/RediStick-Stream-Objects.package/RsStreamIterator.class/instance/basicCurrentId.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
accessing | ||
basicCurrentId | ||
^ currentId |
2 changes: 1 addition & 1 deletion
2
...ory/RediStick-Stream-Objects.package/RsStreamIterator.class/instance/by.do.whileFalse..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
...y/RediStick-Stream-Objects.package/RsStreamIterator.class/instance/contentsFrom.count..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
private | ||
contentsFrom: entryId count: step | ||
^ self stream contentsFrom: entryId count: step |
4 changes: 2 additions & 2 deletions
4
repository/RediStick-Stream-Objects.package/RsStreamIterator.class/instance/currentId.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
accessing | ||
currentId | ||
|
||
^ currentId | ||
currentId ifNil: [ ^ self fallbackId ]. | ||
^ currentId |
4 changes: 4 additions & 0 deletions
4
...ry/RediStick-Stream-Objects.package/RsStreamIterator.class/instance/entriesFrom.count..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
private | ||
entriesFrom: entryId count: step | ||
self isInclusive ifTrue: [ ^ self contentsFrom: entryId count: step ]. | ||
^ self contentsNextFrom: entryId count: step |
3 changes: 3 additions & 0 deletions
3
repository/RediStick-Stream-Objects.package/RsStreamIterator.class/instance/fallbackId.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
private | ||
fallbackId | ||
^ self stream first id |
3 changes: 3 additions & 0 deletions
3
...sitory/RediStick-Stream-Objects.package/RsStreamIterator.class/instance/initCurrentId..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
initialization | ||
initCurrentId: fromIdLikeThing | ||
currentId := fromIdLikeThing ifNotNil: [ fromIdLikeThing asStreamMessageId ]. |
5 changes: 1 addition & 4 deletions
5
repository/RediStick-Stream-Objects.package/RsStreamIterator.class/instance/initFromId..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,3 @@ | ||
initialization | ||
initFromId: fromIdLikeThing | ||
fromId := fromIdLikeThing | ||
ifNil: [ RsStreamMessageId zero ] | ||
ifNotNil: [ fromIdLikeThing asStreamMessageId ]. | ||
currentId := fromId | ||
fromId := fromIdLikeThing ifNotNil: [ fromIdLikeThing asStreamMessageId ]. |
3 changes: 3 additions & 0 deletions
3
repository/RediStick-Stream-Objects.package/RsStreamIterator.class/instance/isInclusive..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
accessing | ||
isInclusive: aBoolean | ||
isInclusive := aBoolean |
4 changes: 4 additions & 0 deletions
4
repository/RediStick-Stream-Objects.package/RsStreamIterator.class/instance/isInclusive.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
testing | ||
isInclusive | ||
isInclusive ifNil: [ ^ currentId isNil ]. | ||
^ isInclusive |
2 changes: 1 addition & 1 deletion
2
repository/RediStick-Stream-Objects.package/RsStreamIterator.class/instance/reversed.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
converting | ||
reversed | ||
^ RsStreamReverseIterator on: self stream nextFrom: self currentId | ||
^ RsStreamReverseIterator on: self stream nextFrom: self basicCurrentId |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
...tick-Stream-Objects.package/RsStreamReverseIterator.class/instance/contentsFrom.count..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
private | ||
contentsFrom: entryId count: step | ||
^ self stream contentsReversedFrom: entryId count: step |
3 changes: 3 additions & 0 deletions
3
...ory/RediStick-Stream-Objects.package/RsStreamReverseIterator.class/instance/fallbackId.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
private | ||
fallbackId | ||
^ self stream last id |
2 changes: 1 addition & 1 deletion
2
...itory/RediStick-Stream-Objects.package/RsStreamReverseIterator.class/instance/reversed.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
converting | ||
reversed | ||
^ RsStreamIterator on: self stream nextFrom: self currentId | ||
^ RsStreamIterator on: self stream nextFrom: self basicCurrentId |