--- a/OrderedDictionary.st Mon Jul 17 15:52:04 2017 +0200
+++ b/OrderedDictionary.st Mon Jul 17 17:02:48 2017 +0200
@@ -309,8 +309,14 @@
^ self associationAt: (order first)
"
- OrderedDictionary new first
+ OrderedDictionary new first
+
+ (OrderedDictionary new at:'one' put:1; yourself) first
+ (OrderedDictionary new at:'one' put:1; yourself) firstKey
+ (OrderedDictionary new at:'one' put:1; yourself) firstValue
"
+
+ "Modified (comment): / 17-07-2017 / 17:01:33 / cg"
!
firstKey
@@ -323,6 +329,11 @@
OrderedDictionary new first
OrderedDictionary new firstKey
+ OrderedDictionary new first
+ (OrderedDictionary new at:'one' put:1; yourself) first
+ (OrderedDictionary new at:'one' put:1; yourself) firstKey
+ (OrderedDictionary new at:'one' put:1; yourself) firstValue
+
OrderedDictionary new
at:'foo' put:'Foo';
at:'bar' put:'Bar';
@@ -333,6 +344,24 @@
at:'bar' put:'Bar';
firstKey
"
+
+ "Modified (comment): / 17-07-2017 / 17:01:17 / cg"
+!
+
+firstValue
+ "Return the first value of the receiver.
+ Provide an error notification if the receiver contains no elements."
+
+ ^ (self associationAt: (order first)) value
+
+ "
+ OrderedDictionary new first
+ (OrderedDictionary new at:'one' put:1; yourself) first
+ (OrderedDictionary new at:'one' put:1; yourself) firstKey
+ (OrderedDictionary new at:'one' put:1; yourself) firstValue
+ "
+
+ "Created: / 17-07-2017 / 17:00:33 / cg"
!
keyAt:index
@@ -372,8 +401,14 @@
^ self associationAt: (order last)
"
- OrderedDictionary new last
+ OrderedDictionary new last
+
+ (OrderedDictionary new at:'one' put:1; yourself) last
+ (OrderedDictionary new at:'one' put:1; yourself) lastKey
+ (OrderedDictionary new at:'one' put:1; yourself) lastValue
"
+
+ "Modified (comment): / 17-07-2017 / 17:01:49 / cg"
!
lastKey
@@ -398,6 +433,30 @@
"
!
+lastValue
+ "Return the last value of the receiver.
+ Provide an error notification if the receiver contains no elements."
+
+ ^ (self associationAt: (order last)) value
+
+ "
+ OrderedDictionary new last
+ OrderedDictionary new lastValue
+
+ OrderedDictionary new
+ at:'foo' put:'Foo';
+ at:'bar' put:'Bar';
+ lastValue
+
+ OrderedDictionary new
+ at:'foo' put:'Foo';
+ at:'bar' put:'Bar';
+ lastValue
+ "
+
+ "Created: / 17-07-2017 / 17:00:18 / cg"
+!
+
order
"returns the keys in the order of their appearance"