Iterator.get
Returns a value the iterator points to.
Arguments
None
Return values
{ key: Key; value: Value; }
for HashTableIterator and RedBlackTreeIterator, plain
value
for all other iterators.
Complexity
Constant
Example
"sl/array" useFile
"sl/linkedList" useFile
"sl/hashTable" useFile
"sl/redBlackTree" useFile
a: (1 2 3) makeArray;
l: (4 5 6) makeList;
ht: ((1 "ONE") (2 "TWO") (3 "THREE")) makeHashTable;
rb: ((4 "FOUR") (5 "FIVE") (6 "SIX")) makeRedBlackTree;
a.firstIter.get print LF print
l.firstIter.get print LF print
ht.firstIter.get print LF print
rb.firstIter.get print
Output:
1
4
{ key: 1; value: "ONE"; }
{ key: 4; value: "FOUR"; }