Get a list of all nodes in the graph that are leaves. A leaf is defined to be a node that has no output.
()
| 114 | * be a node that has no output. |
| 115 | */ |
| 116 | public List<E> getLeaves() { |
| 117 | if (mLeaves.size() == 0 && mOps.size() > 0) { |
| 118 | for (E op : mOps.keySet()) { |
| 119 | if (mFromEdges.get(op) == null) { |
| 120 | mLeaves.add(op); |
| 121 | } |
| 122 | } |
| 123 | } |
| 124 | return mLeaves; |
| 125 | } |
| 126 | |
| 127 | /** |
| 128 | * Given an operator, find its OperatorKey. |