Eiffel Media API
Overview Cluster Class Classes Index      Previous Next      Top Features

structure.container

Class DS_CONTAINER


Direct ancestors

KL_CLONABLE

Known direct descendants

DS_TRAVERSABLE, DS_SEARCHABLE, DS_SORTABLE, DS_RESIZABLE, DS_SPARSE_CONTAINER, DS_TABLE

Features

Invariants

indexing

description

Data structures that can hold zero or more items

library

Gobo Eiffel Structure Library

copyright

Copyright (c) 1999, Eric Bezault and others

license

Eiffel Forum License v2 (see forum.txt)

date

$Date: 2005/06/04 22:16:54 $

revision

$Revision: 1.9 $

deferred class

DS_CONTAINER [G]

inherit

KL_CLONABLE

feature -- Measurement

count: INTEGER

-- Number of items in container

feature -- Comparison

is_equal (other: like Current): BOOLEAN

-- Is current container equal to other?

-- (From ANY)

require
other_not_void: other /= Void
ensure
symmetric: Result implies other.is_equal (Current)
consistent: standard_is_equal (other) implies Result

feature -- Status report

is_empty: BOOLEAN

-- Is container empty?

feature -- Removal

wipe_out

-- Remove all items from container.

ensure
wiped_out: is_empty

feature -- Duplication

cloned_object: like Current

-- Clone of current object

-- (From KL_CLONABLE)

ensure
cloned_not_void: Result /= Void
same_type: ANY_.same_types (Result, Current)
is_equal: Result.is_equal (Current)
copy (other: like Current)

-- Update current object using fields of object attached
-- to other, so as to yield equal objects.

-- (From ANY)

require
other_not_void: other /= Void
type_identity: same_type (other)
ensure
is_equal: is_equal (other)

invariant

positive_count: count >= 0
empty_definition: is_empty = (count = 0)

-- From ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end