# See the License for the specific language governing permissions and
# limitations under the License.
-# management and display of ordered trees
+# Manipulation and presentation of ordered trees.
module ordered_tree
# Generic structure to manage and display an ordered tree
# This class can be used as it to work with generic trees but can also be specialized to provide more specific
# behavior or display. It is why the internal attributes are mutable.
class OrderedTree[E: Object]
- super Streamable
+ super Writable
super Collection[E]
# The roots of the tree (in sequence)
# print the full tree on `o`
# Write a ASCII-style tree and use the `display` method to label elements
- redef fun write_to(stream: OStream)
+ redef fun write_to(stream: Writer)
do
for r in roots do
stream.write display(r)
end
end
- private fun sub_write_to(o: OStream, e: E, prefix: String)
+ private fun sub_write_to(o: Writer, e: E, prefix: String)
do
if not sub.has_key(e) then return
var subs = sub[e]