summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
b0dbd98)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
#
# Also used when one want to give a single element when a full
# collection is expected
#
# Also used when one want to give a single element when a full
# collection is expected
super Collection[E]
redef fun first do return item
super Collection[E]
redef fun first do return item
- redef fun iterator do return new ContainerIterator[E](self)
+ redef fun iterator do return new RefIterator[E](self)
# The stored item
var item: E is writable
end
# This iterator is quite stupid since it is used for only one item.
# The stored item
var item: E is writable
end
# This iterator is quite stupid since it is used for only one item.
-private class ContainerIterator[E]
+private class RefIterator[E]
super Iterator[E]
redef fun item do return _container.item
super Iterator[E]
redef fun item do return _container.item
- var container: Container[E]
end
# Items can be removed from this collection
end
# Items can be removed from this collection
# Linked nodes that constitute a linked list.
private class ListNode[E]
# Linked nodes that constitute a linked list.
private class ListNode[E]
# The next node.
var next: nullable ListNode[E] = null
# The next node.
var next: nullable ListNode[E] = null