Class DS_CONTAINER PreviousNext

note
description:

    "Data structures that can hold zero or more items"

library:    "Gobo Eiffel Structure Library"
author:     "Eric Bezault <ericb@gobosoft.com>"
copyright:  "Copyright (c) 1999, Eric Bezault and others"
license:    "MIT License"
deferred class interface
DS_CONTAINER [G]
feature {NONE} -- Initialization
make_default
        -- Create an empty container.
    deferred
    ensure
        empty: is_empty
feature -- Measurement
count: INTEGER
        -- Number of items in container
    deferred
feature -- Status report
is_empty: BOOLEAN
        -- Is container empty?
feature -- Comparison
is_equal (other: like Current): BOOLEAN
        -- Is current container equal to other?
        -- (From GENERAL.)
    require
        other_not_void: other /= Void
    deferred
    ensure
        consistent: standard_is_equal (other) implies Result
        same_type: Result implies same_type (other)
        symmetric: Result implies other.is_equal (Current)
        same_count: Result implies count = other.count
feature -- Duplication
copy (other: like Current)
        -- Copy other to current container.
        -- (From GENERAL.)
    require
        other_not_void: other /= Void
        type_identity: same_type (other)
    deferred
    ensure
        is_equal: is_equal (other)
feature -- Removal
wipe_out
        -- Remove all items from container.
    deferred
    ensure
        wiped_out: is_empty
invariant
positive_count: count >= 0
empty_definition: is_empty = (count = 0)
end -- class DS_CONTAINER

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

HomeTocPreviousNext