File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2424 *
2525 * <p>WARNING: <code>less</code> takes O(n) time in this implementation. Avoid it.
2626 *
27- * <p>Still unimplemented: <code>restrictedTo</code>, <code>restrictedFrom</code>.
27+ * <p>Still unimplemented: user-supplied comparators; <code>restrictedTo</code>,
28+ * <code>restrictedFrom</code>.
2829 */
2930
3031public class FLinkedHashMap <Key , Val >
@@ -74,6 +75,13 @@ public int size() {
7475 return FHashMap .treeSize (map_tree );
7576 }
7677
78+ /**
79+ * Returns the keys in the map, in order, as an FList.
80+ */
81+ public FList <Key > keyList () {
82+ return new FTreeList <Key >(list_tree , null );
83+ }
84+
7785 public Map .Entry <Key , Val > arb () {
7886 return (Map .Entry <Key , Val >)FHashMap .arb (map_tree );
7987 }
Original file line number Diff line number Diff line change 1818
1919
2020/**
21- * Just like <code>FHashSet</code> except that the iterator returns entries
22- * in the same order in which the keys were first added.
21+ * Just like <code>FHashSet</code> except that the iterator returns elements
22+ * in the same order in which they were first added.
2323 *
2424 * <p>WARNING: <code>less</code> takes O(n) time, in general, in this implementation.
2525 * Avoid it, except in the special case of the element just returned by <code>arb</code>.
2626 *
27- * Still unimplemented: <code>intersection</code>, <code>difference</code>.
27+ * Still unimplemented: user-supplied comparators; <code>intersection</code>,
28+ * <code>difference</code>.
2829 */
2930
3031public class FLinkedHashSet <Elt >
@@ -64,6 +65,13 @@ public int size() {
6465 return FHashSet .treeSize (set_tree );
6566 }
6667
68+ /**
69+ * Returns the contents of the set, in order, as an FList.
70+ */
71+ public FList <Elt > toList () {
72+ return new FTreeList <Elt >(list_tree , null );
73+ }
74+
6775 /**
6876 * On an <code>FLinkedHashSet</code>, always returns the element that was added first.
6977 * (A subsequent call to <code>less</code> passing this element will be efficient.)
You can’t perform that action at this time.
0 commit comments