Class DS_SORTER PreviousNext

note
description:

    "Data structure sorters"

library:    "Gobo Eiffel Structure Library"
author:     "Eric Bezault <ericb@gobosoft.com>"
copyright:  "Copyright (c) 2000-2001, Eric Bezault and others"
license:    "MIT License"
deferred class interface
DS_SORTER [G]
feature -- Status report
sorted (a_container: DS_SORTABLE [G]): BOOLEAN
        -- Is a_container sorted in increasing order?
    require
        a_container_not_void: a_container /= Void
    deferred
reverse_sorted (a_container: DS_SORTABLE [G]): BOOLEAN
        -- Is a_container sorted in decreasing order?
    require
        a_container_not_void: a_container /= Void
    deferred
sorted_with_comparator (a_container: DS_SORTABLE [G]; a_comparator: DS_COMPARATOR [G]): BOOLEAN
        -- Is a_container sorted according to
        -- a_comparator's comparison criterion?
    require
        a_container_not_void: a_container /= Void
        a_comparator_not_void: a_comparator /= Void
    deferred
feature -- Sort
sort (a_container: DS_SORTABLE [G])
        -- Sort a_container in increasing order.
    require
        a_container_not_void: a_container /= Void
    deferred
    ensure
        sorted: sorted (a_container)
reverse_sort (a_container: DS_SORTABLE [G])
        -- Sort a_container in decreasing order.
    require
        a_container_not_void: a_container /= Void
    deferred
    ensure
        sorted: reverse_sorted (a_container)
sort_with_comparator (a_container: DS_SORTABLE [G]; a_comparator: DS_COMPARATOR [G])
        -- Sort a_container according to
        -- a_comparator's comparison criterion?
    require
        a_container_not_void: a_container /= Void
        a_comparator_not_void: a_comparator /= Void
    deferred
    ensure
        sorted: sorted_with_comparator (a_container, a_comparator)
end -- class DS_SORTER

Copyright © 2000-2001, Eric Bezault
mailto:
ericb@gobosoft.com
http:
//www.gobosoft.com
Last Updated: 31 March 2001

HomeTocPreviousNext